0

From the AWS Cognito documents:

https://aws.amazon.com/blogs/mobile/accessing-your-user-pools-using-the-amazon-cognito-identity-sdk-for-javascript/

AWSCognito.config.region = 'us-east-1';

var poolData = {
    UserPoolId : '...', // your user pool id here
    ClientId : '...' // your client id here
};
var userPool = new AWSCognito.CognitoIdentityServiceProvider.CognitoUserPool(poolData);
var userData = {
    Username : '...', // your username here
    Pool : userPool
};

However I do not know which file / where / when to create my instance of the userPool.

It makes sense for me to do it in the app.component.ts, but I am unsure if this is right.

I also don't understand where I import the AWSCognito function from, I cannot find the right library to do this.

Thank you for any help.

JoshuaESummers
  • 493
  • 2
  • 7
  • 24
  • I would do this AWS amplify tutorial as once you understand how it works, you'll have an easy time with this: https://www.youtube.com/watch?v=uiTQL7Ne8rY – Ole Feb 06 '20 at 19:12
  • 1
    Thanks Ole. I will give it a go. Thank you for your help with all this – JoshuaESummers Feb 06 '20 at 19:25
  • @Ole I tried watching the video but I am still no deeper in my understanding. I see there is a aws_user_pools_id and aws_user_pools_web_client_id in the aws-export.js file, so I could reset them, however there are many other ids in the file too... and I only have the userpoolid and the clientid. – JoshuaESummers Feb 07 '20 at 19:10
  • Try generating the file with only a Cognito user Pool setup. If you add other services, then these will have settings as well. – Ole Feb 08 '20 at 03:40
  • This guy also has a really good explanation of how to setup a user pool: https://youtu.be/t_eH9en9lP4 – Ole Feb 08 '20 at 04:15

0 Answers0