Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Dashboard Configuration
Simply toggle on “Email” in the Log in & User Profile section of the dashboard.
If users report delayed or missing OTP emails, see the Email OTP delivery troubleshooting guide.
Prerequisites
Before this: create and initialize a Dynamic client (see Creating a Dynamic Client, Initializing the Dynamic Client).
Usage
import {
sendEmailOTP,
verifyOTP
} from '@dynamic-labs-sdk/client';
// With the user's email, call sendEmailOTP to get the otpVerification
// Then, once the user inputs the OTP code, call verifyOTP to verify it and complete the authentication
let otpVerification = null;
const signInWithEmail = async () => {
// Replace 'test@test.com' with the user's email address
otpVerification = await sendEmailOTP({ email: 'test@test.com' });
// Store the otpVerification for later use with the verifyOTP function
};
const handleVerifyOTP = async () => {
// Use the same otpVerification object that you got from the sendEmailOTP function
// Replace '123456' with the OTP code entered by the user
await verifyOTP({ otpVerification, otp: '123456' });
};
Rate Limits
Email verification is subject to the following rate limits:
- 3 attempts per 10 minutes per email address
This is in place to protect deliverability of emails and to prevent abuse.
If users report delayed or missing OTP emails, see the Email OTP delivery troubleshooting guide.