Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ot06/aws-cognito

Package Overview
Dependencies
Maintainers
3
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ot06/aws-cognito

AWS Cognito SDK

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
3
Weekly downloads
 
Created
Source

AWS Cognito SDK (v1.0.x)

Installation

This package requires Node Version v14.18.2+

Installing the package:

npm i @ot06/aws-cognito

Environment Variables to Set

  • COGNITO_REGION (Optional; Default: ap-south-1) AWS Region of the Cognito Instance is to be used

  • COGNITO_ENABLED (Default: false) Flag to enable Cognito Persistent Client

  • COGNITO_USER_POOL_ID Default 'UserPoolId' to be used

  • COGNITO_APP_CLIENT_ID Default 'ClientId' to be used

  • COGNITO_APP_CLIENT_SECRET Default 'ClientSecret' to be used

  • COGNITO_API_VERSION (Optional; Default: 2016-04-18) API Version of AWS Cognito APIs being used

Schema Options

  1. type (string) - Defines the Datatype of the property -- string -- number -- boolean -- array -- object
  2. isCustom (boolean) - Denotes that the property is a Custom Attribute

Example User Schema

const UserSchema = {
  Username: { type: 'string' },
  name: { type: 'string' },
  email: { type: 'string' },
  role: { type: 'string', isCustom: true },
  userId: { type: 'number', isCustom: true },
  isActive: { type: 'boolean', isCustom: true },
  tags: { type: 'array', isCustom: true },
  acl: { type: 'object', isCustom: true }
}

How to Use

import CognitoSdk from '@ot06/aws-cognito'
const cognitoSdk = new CognitoSdk(UserSchema)

SDK Methods

  • adminCreateUser
  • adminDeleteUser
  • adminDisableUser
  • adminEnableUser
  • adminGetUser
  • adminUpdateUserAttributes
  • adminResetUserPassword
  • adminSetUserPassword
  • adminInitiateAuth
  • customAdminLoginUser
  • customAdminRefreshUserToken
  • customValidateToken
  • changePassword
  • forgotPassword
  • getUser
  • listUsers
  • revokeToken

NOTE: -- Usage of these methods is similar to the commands from the package @aws-sdk/client-cognito-identity-provider. Internally, the same is being used. Setting the right environment variables will eliminate their mandatory passing to these methods.

--The only change in the Input data structures are the 'Attributes' and 'UserAttributes' properties. You need to pass values as User objects structures as defined by 'UserSchema'

License

MIT

Free Software, Hell Yeah!

FAQs

Package last updated on 02 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc