Send an One Time Password (OTP) via the Twilio SMS gateway
Updated Jun 06, 2023
Version 2.0Was this article helpful?
I didn't try that myself, but according to the docs you should use something like this:
// Download the helper library from https://www.twilio.com/docs/node/install
// Your Account Sid and Auth Token from twilio.com/console
const accountSid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
const authToken = 'your_auth_token';
const client = require('twilio')(accountSid, authToken);
client.messages
.create({
body: 'Phantom Menace was clearly the best of the prequel trilogy.',
messagingServiceSid: 'MG9752274e9e519418a7406176694466fa',
to: '+441632960675'
})
.then(message => console.log(message.sid))
.done();