Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

112
Views
AWS Cognito Sync ListRecords using AWS CLI vs. Browser Javascript Call

I can call the following in the AWS CLI in order to access records of a user:

aws cognito-sync list-records --identity-id 'xxxxxxx' --dataset-name 'xxxxxxx' --identity-pool-id 'xxxxxx'

This specific user does not have any records associated with it, and I receive a empty list for records, however I receive additional information such as count and SyncCount etc.

However when I use the following javascript code in my file, I return an TypeError with no information listed in data. Data returns null. There is additional information to be had that was listed by the AWS CLI call.

var identityId = AWS.config.credentials.identityId;
    
    AWS.config.credentials = new AWS.CognitoIdentityCredentials({
        IdentityPoolId: identityPoolId,
        IdentityId: identityId,
        DatasetName: cognitoDatasetName

    });

    let cognitosync = new AWS.CognitoSync();

    var params = {
        DatasetName: cognitoDatasetName,
        IdentityId: identityId,
        IdentityPoolId: identityPoolId
    };

    cognitosync.listRecords(params, function (err, data) {
        if (err) {
            console.log("listRecords: " + err, err.stack);
            console.log(data);
        } // an error occurred 
        else {
            console.log("listRecords: " + JSON.stringify(data));
            var cognitoSyncToken = data.SyncSessionToken;
            var cognitoSyncCount = data.DatasetSyncCount;
            console.log("SyncSessionToken: " + cognitoSyncToken);           
            console.log("DatasetSyncCount: " + cognitoSyncCount);
            addRecord(cognitoSyncToken, cognitoSyncCount);
        }
    });
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!