Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

106
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda