sendEmailOtp
Send a one-time password (OTP) to a user’s email address for authentication.Parameters
- client (DynamicClient) - Initialized Dynamic client
 - email (String) - User’s email address
 
Returns
- OTPVerification - Verification object containing the verification UUID
 
Example
sendSmsOtp
Send a one-time password (OTP) to a user’s phone number via SMS.Parameters
- client (DynamicClient) - Initialized Dynamic client
 - phoneNumber (String) - User’s phone number (without country code)
 - phoneCountryCode (String) - Country code (e.g., “+1”)
 - isoCountryCode (String) - ISO country code (e.g., “US”)
 
Returns
- OTPVerification - Verification object containing the verification UUID
 
Example
verifyOtp
Verify an email OTP code and authenticate the user.Parameters
- otpVerification (OTPVerification) - Verification object from sendEmailOtp
 - verificationToken (String) - OTP code entered by user
 
Returns
- SdkUser - Authenticated user object
 
Example
verifySmsOtp
Verify an SMS OTP code and authenticate the user.Parameters
- otpVerification (OTPVerification) - Verification object from sendSmsOtp
 - verificationToken (String) - OTP code entered by user
 
Returns
- SdkUser - Authenticated user object
 
Example
logout
Clear the current authentication state and log out the user.Parameters
- client (DynamicClient) - Initialized Dynamic client