@msg91comm/otp
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published

MSG91 OTP

Promise based library for the browser and nodejs.

Setup Your MSG91 Account / Get Credentials - (https://msg91.com/in/send-otp/)

Installing

$ npm install @msg91comm/otp

Example

import msg91 from "@msg91comm/otp";
msg91.setup({
    authToken: "YOUR_AUTH_TOKEN",
    templateId: "OTP_TEMPLATE_ID"
});

const otp = msg91.createOTP("MOBILE_NUMBER_WITH_COUNTRY_CODE");

// Send OTP
otp.send();

// Resend/ Retry OTP
otp.retry();

// Verify OTP
otp.verify("ENTER_OTP_RECEIVED_BY_USER");

CommonJS

const msg91 = require('@msg91comm/otp').default;

Package Sidebar

Install

npm i @msg91comm/otp

Weekly Downloads

6

Version

1.0.6

License

ISC

Unpacked Size

8.84 kB

Total Files

6

Last publish

Collaborators

  • vikas_13
  • sulbha29
  • ankit_programmer
  • tigermsg91
  • msg91com