Socket
Socket
Sign inDemoInstall

@adastradev/user-management-sdk

Package Overview
Dependencies
6
Maintainers
36
Versions
113
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adastradev/user-management-sdk

Astra user management SDK for JavaScript in the browser and Node.js


Version published
Maintainers
36
Weekly downloads
375
decreased by-29.64%

Weekly downloads

Readme

Source

user-management-sdk-js

codecov

Ad Astra user management SDK for JavaScript in the browser and Node.js

Tools

AuthManager (Class)

The AuthManager class can be used to:

Sign in a user through AWS's managed Cognito identity provider

.signIn( email, password, newPassword = '' ) => Promise -> CognitoUserSession

Used to obtain a CognitoUserSession.

Get/refresh credentials, and set environment credentials with one function

.getAndSetEnvironmentCredentials() => Promise -> CognitoIdentityCredentials

This will set the following environment variables from the CognitoIdentityCredentials object:

process.env.AWS_ACCESS_KEY_ID
process.env.AWS_SECRET_ACCESS_KEY
process.env.AWS_SESSION_TOKEN

This function is equivalent to:

const creds = await authManagerInstance.refreshCognitoCredentials();
authManagerInstance.setEnvironmentIAMCreds(creds);
Get/refresh cognito credentials, and federated identity credentials

.refreshCognitoCredentials() => Promise -> CognitoIdentityCredentials

Returns a promise which resolves a fresh CognitoIdentityCredentials object after signing in.

Set credentials in the environment

.setEnvironmentIAMCreds(creds: CognitoIdentityCredentials) => void

This will set the following environment variables from the CognitoIdentityCredentials object:

process.env.AWS_ACCESS_KEY_ID
process.env.AWS_SECRET_ACCESS_KEY
process.env.AWS_SESSION_TOKEN

FAQs

Last updated on 06 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc