amazon-archives / amazon-cognito-identity-js

Amazon Cognito Identity SDK for JavaScript
Other
984 stars 454 forks source link

TypeError while useing amazon.cognito-identity-js #665

Closed engharb closed 6 years ago

engharb commented 6 years ago

Hello, I have download and integrate the following files

<script src="/path/to/aws-cognito-sdk.min.js"></script>
    <script src="/path/to/amazon-cognito-identity.min.js"></script>
<script src="/js/aws-sdk.js"></script>

and when I am calling AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool I used to get

Uncaught TypeError: Cannot read property 'CognitoIdentityServiceProvider' of undefined

Uncaught TypeError: AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool is not a constructor

Any suggestions?

Regards,

itrestian commented 6 years ago

You can have a look at AWS Amplify which exposes a higher order auth component for this SDK. Maybe that can suit your use case. Also note that we will continue developing this library in the AWS Amplify repo. The syntax should be a little different now as well and the AWS SDK dependency is not needed anymore.

https://github.com/aws/aws-amplify