Skip to content

Instantly share code, notes, and snippets.

@werdan
Created September 2, 2015 10:38
Show Gist options
  • Save werdan/3d8b7ad34cf60649a074 to your computer and use it in GitHub Desktop.
Save werdan/3d8b7ad34cf60649a074 to your computer and use it in GitHub Desktop.
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