5

As aws-sdk is huge to use at browser side, and also that I'm using Webpack, so it made more sense to only include clients which I'm using (like import S3 from 'aws-sdk/clients/s3'). However I'm failing to configure the credentials for clients like here I am able to do in my AWS import:

AWS.config.update({
  region: '<a-region>',
  credentials: new AWS.CognitoIdentityCredentials({
    IdentityPoolId: '<an-identifier>',
  }),
});

In aws-sdk, while type (of TypeScript) shows that CognitoIdentityCredentials is directly exportable from aws-sdk/lib/credentials/cognito_identity_credentials, it actually isn't. I'm unable to find another way to import CognitoIdentityCredentials directly in my project.

Ajit
  • 875
  • 1
  • 10
  • 20

0 Answers0