Skip to main content

Twilio configuration

Using this method, you can:

  • Send emails using your own domain
  • Optionally customise the default email templates and subject.
import supertokens from "supertokens-node";
import Passwordless from "supertokens-node/recipe/passwordless";
import Session from "supertokens-node/recipe/session";
import { TwilioService } from "supertokens-node/recipe/passwordless/smsdelivery";

supertokens.init({
appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
},
recipeList: [
Passwordless.init({
smsDelivery: {
service: new TwilioService({
twilioSettings: {
accountSid: "...",
authToken: "...",
opts: {
// optionally extra config to pass to Twilio client
},

// give either from or messagingServiceSid
from: "...",
messagingServiceSid: "...",
},
})
},
}),
Session.init()
]
});

To learn about how to customise the SMS templates, please see the next section.

Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI