0.0.3 • Published 5 years ago

@random-guys/sp-otp v0.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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
  }
})