1.0.1 • Published 3 years ago

lami-sdk v1.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
3 years ago

Introduction

This npm package helps us interact with various Lami services.

Contents

  1. Installation
  2. Authentication
  3. SMS

Installation

Run

npm install lami-sdk

Authentication

App actions

import App from 'lami-sdk/lib/auth/app';

const app  = new LamiUser("test@lami.world","testpassword");

/** get access token @param clientSecret */
let response = await app.getAccessToken(clientSecret);

/** verify token @param userPoolId @param tokenUse @param userPoolId */
let response = await app.verify(token,tokenUse,userpoolId);

User actions

import LamiUser from 'lami-sdk/lib/auth/user'

const lamiUser  = new LamiUser("test@lami.world","testpassword");

/** Login @param clientId */
let response = await lamiUser.login(clientId);

/** Register @param userPoolId */
let response = await lamiUser.register(userPoolId);

SMS

Sending and SMS/Text message

import SMS from 'lami-sdk/lib/sms'

const sms  = new SMS();

/** Send @param message - message
     * @param subject - subject of the message
     * @param phoneNumber - user phone number */
let response = await sms.send(message: string,subject: string,phoneNumber: string);
1.0.1

3 years ago

1.0.0

3 years ago