@msg91comm/otp
v1.0.6
Published
Package for sending OTP with msg91.
Downloads
2
Readme
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;