The methods below can be used to send/resend and verify one time passwords
Copy
Ask AI
// Send, retry and then verify OTP to an emailawait dynamicClient.auth.email.sendOTP('someone@gmail.com')await dynamicClient.auth.email.resendOTP()await dynamicClient.auth.email.verifyOTP('received-token')// Send, retry and then verify OTP to a phone numberawait dynamicClient.auth.sms.sendOTP({ dialCode: '1', iso2: 'us', phone: '2793334444',})await dynamicClient.auth.sms.resendOTP()await dynamicClient.auth.sms.verifyOTP('received-token')
The example below demonstrates a React component that can send, resend and verify OTPs through email.You can follow the same pattern for phone numbers but collect phone number, iso2 and dial code instead
of email address.