Skip to main content

TypeScript SDK

Changing password

import { Auth } from '@scribelabsai/auth';
const access = new Auth({ clientId, userPoolId });
access.changePassword(username: 'username', password: 'password', newPassword: 'newPassword')

Recovering an account in case of forgotten password

import { Auth } from '@scribelabsai/auth';
const access = new Auth({ clientId, userPoolId });
access.forgotPassword(username: 'username', password: 'password', confirmationCode: 'confirmationCode')

Get or generate tokens

With username and password

import { Auth } from '@scribelabsai/auth';
const access = new Auth({ clientId, userPoolId });
access.getTokens({ username: 'username', password: 'password' });

With refresh token

import { Auth } from '@scribelabsai/auth';
const access = new Auth({ clientId, userPoolId });
access.getTokens({ refreshToken: 'refreshToken' });

Get federated id

import { Auth } from '@scribelabsai/auth';
const poolAccess = new Auth({
clientId: clientId,
userPoolId: userPoolId,
identityPoolId: federatedPoolId,
});
access.getFederatedId(idToken: 'idToken');

Get federated credentials

import { Auth } from '@scribelabsai/auth';
const poolAccess = new Auth({
clientId: clientId,
userPoolId: userPoolId,
identityPoolId: federatedPoolId,
});
access.getFederatedCredentials(id: 'federatedId', idToken: 'idToken');