Search code examples
aws-sdk-js

AWS.config.credentials.identityId not found in typescript


Following the guide I would like retrieve a unique Amazon Cognito identifier (identity ID) after I've set the login tokens in the credentials provider, but I'm not able to take the identityId in AWS.config.credentials.identityId (but i can see it if I use console.log(AWS.config.credentials);.

Any Solutions?


Solution

  • (AWS.config.credentials as AWS.CognitoIdentityCredentials).identityId

    It seems to work