0.0.1 • Published 2 years ago

@the-colony/sdk v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

The Colony SDK

Modules

Authentication module

Authenticate

The authenticate method was designed to handle the user authentication process within the SDK. It takes two parameters: email, which represents the user's email address, and password, which represents the user's password.

This method returns a Promise that resolves to an Authentication object when the authentication process is successfully completed.

method signature
authenticate(email: string, password: string): Promise<Authentication>
method usage
const { token, user_id } = await TheColonySDK.authenticate('example@domain.com', '123qwe!"#QWE');

Request Recovery Password

The requestRecoveryPassword method enables users to initiate the password recovery process. It takes a single parameter, email, which represents the user's email address. This method returns a Promise that resolves to a request_id when the requestRecoveryPassword process is successfully completed.

This method sends an authorized link to the specified email address, allowing the user to complete the password recovery request.

method signature
requestRecoveryPassword(email: string): Promise<string>
method usage
const { request_id } = await TheColonySDK.requestRecoveryPassword('example@domain.com');

Recovery Password

method signature
recoveryPassword(email: string, password: string, token: string): Promise<Authentication>
method usage
const { token, user_id } = await TheColonySDK.recoveryPassword('example@domain.com', '456rty$%&RTY', '67a3a4e7-a018-454d-bd33-1fd2815ef88a');

Users module

el modulo de autenticacion se encarga de manejar el acceso y recupero de cuentas y proveer tokens de acceso.

Types

ID

export type IDType = string;

Authentication

export type Authentication = {
  user_id: IDType;
  token: string;
}