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

@adastradev/user-management-sdk

Package Overview
Dependencies
Maintainers
0
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 5.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
590
increased by2.61%
Maintainers
0
Weekly downloads
 
Created
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

Package last updated on 04 Sep 2024

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