@nauth-toolkit/sms-twilio
v0.3.3
Published
Twilio SMS provider for nauth-toolkit
Downloads
677
Readme
@nauth-toolkit/sms-twilio
Twilio SMS provider for nauth-toolkit.
Sends verification codes and MFA one-time passwords via the Twilio Programmable Messaging API. Supports a direct sender number or a Twilio Messaging Service.
Part of nauth-toolkit. Requires
@nauth-toolkit/core.
Install
npm install @nauth-toolkit/sms-twilioConfigure in your auth config with a sender number:
import { TwilioSMSProvider } from '@nauth-toolkit/sms-twilio';
const authConfig = {
smsProvider: new TwilioSMSProvider({
accountSid: process.env.TWILIO_ACCOUNT_SID!,
authToken: process.env.TWILIO_AUTH_TOKEN!,
fromNumber: '+15551234567',
}),
};Or with a Twilio Messaging Service (provide either fromNumber or messagingServiceSid, not both):
const authConfig = {
smsProvider: new TwilioSMSProvider({
accountSid: process.env.TWILIO_ACCOUNT_SID!,
authToken: process.env.TWILIO_AUTH_TOKEN!,
messagingServiceSid: process.env.TWILIO_MESSAGING_SERVICE_SID!,
}),
};Other SMS providers
| Package | Purpose |
| --- | --- |
| @nauth-toolkit/sms-aws-sns | AWS SNS |
| @nauth-toolkit/sms-console | Console logging for development |
See the full package list in the core README.
MIT licensed. See LICENSE.
