1.0.6 • Published 3 years ago

@msg91comm/otp v1.0.6

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

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;