title: Unable to use vanilla JS for AWS Cognito, and get AmazonCognitoIdentity is not defined
body: <p>I follow the instructions from <a href="https://github.com/aws/aws-amplify/tree/master/packages/amazon-cognito-identity-js" rel="nofollow noreferrer">https://github.com/aws/aws-amplify/tree/master/packages/amazon-cognito-identity-js</a></p>
  
  <p>Here is my html code:</p>
  
  <pre><code>&lt;html&gt;
  
    &lt;head&gt;
      &lt;title&gt;Testing AWS Cognito&lt;/title&gt;
      &lt;script src="/js/aws/aws-cognito-sdk.js"&gt;&lt;/script&gt;
      &lt;script src="https://sdk.amazonaws.com/js/aws-sdk-2.211.1.min.js"&gt;&lt;/script&gt;
  
  
    &lt;/head&gt;
  
    &lt;body&gt;
      &lt;div&gt;
        &lt;input type="text" id="email" name="email" placeholder="email"&gt; &lt;br/&gt;
        &lt;input type="text" id="username" name="username" placeholder="username"&gt;&lt;br/&gt;
        &lt;input type="text" id="phone" name="phone" placeholder="phone"&gt;&lt;br/&gt;
        &lt;input type="text" id="password" name="password" placeholder="password"&gt;&lt;br/&gt;
        &lt;button id="signup" onClick="register()" &gt;Register&lt;/button&gt;
      &lt;/div&gt;
  
      &lt;script&gt;
        const register = function() {
          console.log("onclick loading now");
          var CognitoUserPool = AmazonCognitoIdentity.CognitoUserPool;
        }
      &lt;/script&gt;
  
    &lt;/body&gt;
  
  
  &lt;/html&gt;
  </code></pre>
  
  <p>But when I run it, it gives me: </p>
  
  <blockquote>
    <p>"signup_aws_test.html:32 Uncaught ReferenceError:
    AmazonCognitoIdentity is not defined"</p>
  </blockquote>
  
  <p>I am very sure both files are loaded before I click the button. </p>
  
  <p>in the aws-cognito-sdk.js, I can see that AmazonCognitoIdentity exists and exports.  It doesn't seems like it is in the global namespace though.<br>
  Do i need to run something else to "Load" it? </p>