Created
September 2, 2015 10:38
-
-
Save werdan/3d8b7ad34cf60649a074 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AWS.config.region = 'us-east-1'; | |
AWS.config.credentials = new AWS.CognitoIdentityCredentials({ | |
IdentityPoolId: 'us-east-1:123123123123123123123', | |
}); | |
AWS.config.credentials.get(function() { | |
var syncClient = new AWS.CognitoSyncManager(); | |
syncClient.openOrCreateDataset('myDataset', function(err, dataset) { | |
dataset.put('myKey', 'myValue' + Math.random(), function(err, record){ | |
dataset.synchronize({ | |
onSuccess: function(data, newRecords) { | |
console.log("successful"); | |
} | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment