Skip to Content
You are viewing a beta version of Clerk Docs
Visit the latest docs
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

Email verification

These are all methods on the SignUp class that allow you to verify a user's sign-up request via email.

prepareEmailAddressVerification()

Helper method that allows you to initiate a verification process for an email address. It basically sends a one-time code to the email address already supplied to the current sign-up.

The defaults of this method are equivalent to calling SignUp.prepareVerification('email_code').

function prepareEmailAddressVerification(params?: PrepareEmailAddressVerificationParams): Promise<SignUpResource>;

PrepareEmailAddressVerificationParams

NameTypeDescription
strategy'email_code' | 'email_link'The verification strategy to validate the user's sign-up request.
The following strategies are supported:
  • email_code: Send an email with a unique token to input.
  • email_link: Send an email with a link which validates sign-up
redirectUrlstringThe URL to redirect the user to after the verification process is complete.
Only supported on email_link, oauth_<provider>, and saml strategies.

prepareEmailAddressVerification() returns

TypeDescription
Promise<SignUpResource>A Promise which resolves to the current SignUp.

attemptEmailAddressVerification()

Helper method that attempts to complete the verification process for an email address. It basically verifies that the supplied code is the same as the one-time code that was sent to the email address during the prepare verification phase.

This is equivalent to calling SignUp.attemptVerification({strategy: 'email_code', ...params}).

function attemptEmailAddressVerification(params: AttemptEmailAddressVerificationParams): Promise<SignUpResource>;

AttemptEmailAddressVerificationParams

NameTypeDescription
codestringThe code that was sent to the user via email.

attemptEmailAddressVerification() returns

TypeDescription
Promise<SignUpResource>A Promise which resolves to the current SignUp.

Last updated on October 5, 2023

What did you think of this content?

Clerk © 2024