email flow of a createAuthClient client. sendOtp emails the user a one-time code; verifyOtp exchanges it for a Dynamic user JWT.
sendOtp
Function Signature
Parameters
email(string) - The user’s email address. Dynamic sends the one-time code to it.
Returns
verificationUUID(string) - Identifies this verification attempt. Pass it toverifyOtptogether with the code.
verifyOtp
Function Signature
Parameters
verificationUUID(string) - The value returned bysendOtp.code(string) - The one-time code the user received by email. Collect it through your own channel; never log or persist it.sessionPublicKey(string, optional) - Compressed P-256 public key hex from generateSessionKeyPair. Binds the session key into the minted JWT — required if you will use a session signer with authenticateJwt forbackUpToDynamicflows.
Returns
Promise<AuthResult>-{ jwt, expiresAt, userId }. PassjwttoauthenticateJwt; never log it.
Example
Error Handling
sendOtp and verifyOtp are rate limited per IP address (429 when exceeded) — see Rate Limit Policies.
Related Functions
createAuthClient()- Create the auth client- Wallet sign-in - Private-key-based alternative
authenticateJwt()- Use the minted JWT