@adastradev/user-management-sdk
v5.0.8
Published
Astra user management SDK for JavaScript in the browser and Node.js
Downloads
2,408
Maintainers
Keywords
Readme
user-management-sdk-js
Ad Astra user management SDK for JavaScript in the browser and Node.js
Tools
AuthManager (Class)
The AuthManager class can be used to:
.signIn( email, password, newPassword = '' )
=> Promise -> CognitoUserSession
Used to obtain a CognitoUserSession.
.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);
.refreshCognitoCredentials()
=> Promise -> CognitoIdentityCredentials
Returns a promise which resolves a fresh CognitoIdentityCredentials object after signing in.
.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