Skip to main content

If you are using our backend SDK that is lesser than the following versions, please visit the older documentation link here.

Pre / Post Hooks / Override

We provide you funtionality to run code before and after an SMS is sent. You can use this for:

  • Logging purposes
  • Spam protection purposes
  • Modifying the SMS template variables before sending the SMS
import supertokens from "supertokens-node";
import Passwordless from "supertokens-node/recipe/passwordless";
import Session from "supertokens-node/recipe/session";

appInfo: {
apiDomain: "...",
appName: "...",
websiteDomain: "..."
recipeList: [
smsDelivery: {
override: (originalImplementation) => {
return {
sendSms: async function (input) {
// TODO: before sending SMS

await originalImplementation.sendSms(input)

// TODO: after sending SMS
Looking for older versions of the documentation?
Which UI do you use?
Custom UI
Pre built UI