0.9.1 • Published 2 years ago

cognito-js v0.9.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Cognito JS

A JS Wrapper for client-cognito-identity AWS-SDK V3

Installation

$ npm install cognito-js

Typescripts devs: all types are included in the package :smile:

Usage

import CognitoJS from "cognito-js";

const cognito = new CognitoJS({
  USER_POOL_ID: "your_user_pool_id",
  COGNITO_CLIENT_ID: "your_client_id",
  COGNITO_CLIENT_SECRET: "your_client_secret",
});

cognito
  .signIn("my_username", "my_password")
  .then((response) => {
    // do something with the response
  })
  .catch((error) => {
    // do something with the error
  });