I'm using this example to setup a registration/login UI with an AWS Cognito user pool: https://medium.com/@gmonne/custom-authentication-using-aws-cognito-e0b489badc3f
The author suggests keeping the user pool and application IDs private by creating a config.js file that saves this information in two global variables. From the readme.md:
Before running this code you should create a JavaScript file inside the
javascriptfolder calledconfig.js. Here you should set your "User Pool" id and app client id on the window object using the names:USER_POOL_ID, andCLIENT_ID.
I set the variables in config.js as follows, but get a USER_POOL_ID is not defined error.
var USER_POOL_ID: "us-east-1_#######";
var APP_CLIENT_ID: "7pcmh9gre807########";
From the cognito.js file in the example:
(function(win, CognitoUserPool) {
var CognitoUserPool = window.AmazonCognitoIdentity.CognitoUserPool,
AWSCognito = window.AWSCognito,
CognitoIdentityServiceProvider = AWSCognito.CognitoIdentityServiceProvider,CognitoUserAttribute = CognitoIdentityServiceProvider.CognitoUserAttribute,
CognitoUser = CognitoIdentityServiceProvider.CognitoUser,
AuthenticationDetails = CognitoIdentityServiceProvider.AuthenticationDetails,
UserPool = new CognitoUserPool({
UserPoolId : window.USER_POOL_ID, // Your user pool id here
ClientId : window.CLIENT_ID, // Your client id here
What is the syntax to set the IDs on the window object as mentioned in the readme?