SMS OTP Login with Web3Auth
Web3Auth provides built-in support for email and SMS-based authentication, allowing users to log in seamlessly using a one-time passcode (OTP) sent to their email address or phone number. This form of passwordless authentication simplifies the onboarding process, removes friction for end users, and expands accessibility—especially in regions where social login options may be limited.

Set Up a Custom SMS OTP Connection
To use this feature, developers must first enable SMS OTP
from the Social Connections section in
the Web3Auth Dashboard.
By default, Web3Auth uses its own pre-configured credentials for SMS OTP login.

For enhanced control and branding, developers are encouraged to configure a custom SMS OTP connection. Follow these steps:
- Visit the Web3Auth Dashboard.
- Go to the
Social Connections
section. - Click the
Settings
icon next to the toggle forSMS OTP
. - Enter your custom
Auth Connection ID
. - Click
Add Connection
to complete the setup.

Usage
import { WALLET_CONNECTORS, WEB3AUTH_NETWORK } from "@web3auth/modal";
import { type Web3AuthContextConfig } from "@web3auth/modal/react";
const web3AuthContextConfig: Web3AuthContextConfig = {
web3AuthOptions: {
clientId: "YOUR_CLIENT_ID",
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,
modalConfig: {
connectors: {
[WALLET_CONNECTORS.AUTH]: {
label: "auth",
loginMethods: {
sms_passwordless: {
name: "SMS Passwordless",
authConnection: AUTH_CONNECTION.SMS_PASSWORDLESS,
authConnectionId: "sms-test-demo", // Replace with your custom SMS OTP Auth Connection ID
},
},
},
},
},
},
};
export default web3AuthContextConfig;
Follow our Quickstart Guide to setup the basic flow.