@random-guys/sp-otp
v0.0.3
Published
Library encapsulating Sterling OTP service
Downloads
3
Readme
sp-otp
IBS service as a nodejs library
How to install?
yarn add @radom-guys/sp-otp
How does it work?
import { OTPService } from '@random-guys/sp-otp';
import { unsafeClient, unsafeRun } from '@random-guys/lux';
unsafeRun(async () => {
let client = await unsafeClient(SERVICE_URL)
let service = new OTPService(client, 1)
let isCreated = await service.create(phoneNumber)
// in another function/handler
if (await service.validate(phoneNumber, otp)) {
// do something
}
})