Get started with amplifyjs CDN

(MIT OR GPL) licensed

AmplifyJS: Lightweight library for HTML5 apps, adds touch, geolocation, local storage.

Tags:
  • amplifyjs
  • amplify
  • api

Stable version

Copied!

How to start using amplifyjs CDN


<!DOCTYPE html>
<html>
<head>
  <title>Get started with amplifyjs CDN - cdnhub.io</title>
  <script src="https://cdn.cdnhub.io/amplifyjs/1.1.2/amplify.min.js"></script>
</head>
<body>
  <button id="button">Click me</button>
  <script>
    // Initialize Amplify with your AWS credentials
    Amplify.configure({
      "aws_project_region": "us-east-1",
      "aws_cognito_identity_pool_id": "your-identity-pool-id",
      "aws_cognito_region": "us-east-1",
      "aws_user_pools_id": "your-user-pool-id",
      "aws_user_pools_web_client_id": "your-app-client-id"
    });

    // Attach a click event to the button
    document.getElementById('button').addEventListener('click', async () => {
      try {
        // Sign in using Amplify
        await Amplify.Auth.signIn('[email protected]', 'password');
        console.log('Signed in');
      } catch (error) {
        console.error('Error signing in:', error);
      }
    });
  </script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!

All versions