It seems bizarre and unnatural that I should have to get 3 allied script files from 3 unrelated locations to do one simple thing. Is there a single source location for all the AWS SDK js scripts that I need to develop the client-side of a web-site? I only require the Cognito service.
I am following this tutorial here, to demonstrate how to register a new user to an Amazon Cognito User Pool via a browser.
The scripts linked in the head of the html file are something like ...
<script src="js/amazon-cognito-auth.min.js"></script> <script src="https://sdk.amazonaws.com/js/aws-sdk-2.668.0.min.js"></script> <script src="js/amazon-cognito-identity.min.js"></script> After these scripts are loaded, and the user requests registration, the following is a an over-simplified version of the javascript that gets executed, leveraging these 3 scripts:
poolData = {UserPoolId: <redacted>, ClientId: <redacted>}; var userPool = new AmazonCognitoIdentity.CognitoUserPool( poolData); userPool.signUp( username, password) Following the tutorial instructions, I source amazon-cognito-auth from:
I source amazon-cognito-identity by executing (windows):
- npm install amazon-cognito-identity-js
And of course https://sdk.amazonaws.com/js/aws-sdk.js is a direct link.
Please advise how to get all 3 scripts from a single unified source.
As an ancillary question, does the AWS JS SDK support the require-js module loader?