SignUpFuture
The SignUpFuture
object holds the state of the current sign-up attempt and provides methods to drive custom sign-up flows, including email/phone verification, password, SSO, ticket-based, and Web3-based account creation.
TKTKTK
Properties
- Name
id
- Type
string | undefined
- Description
The unique identifier for the current sign-up attempt.
- Name
status
- Type
SignUpStatus
- Description
The status of the current sign-up. The following values are possible:
complete:
The user has been created and the custom flow can proceed tosignUp.finalize()
to create session.missing_requirements:
A requirement is unverified or missing from the User & authentication settings. For example, in the Clerk Dashboard, the Password setting is required but a password wasn't provided in the custom flow.abandoned:
The sign-up has been inactive for over 24 hours.
- Name
requiredFields
- Type
SignUpField[]
- Description
The list of required fields for the current sign-up attempt.
- Name
optionalFields
- Type
SignUpField[]
- Description
The list of optional fields for the current sign-up attempt.
- Name
missingFields
- Type
SignUpField[]
- Description
The list of missing fields for the current sign-up attempt.
- Name
unverifiedFields
- Type
SignUpIdentificationField[]
- Description
An array of strings representing unverified fields such as
’email_address’
. Can be used to detect when verification is necessary.
- Name
isTransferable
- Type
boolean
- Description
Indicates that there is a matching user for provided identifier, and that the sign-up can be transferred to a sign-in.
- Name
existingSession
- Type
{ sessionId: string } | undefined
- Description
TKTKTK
- Name
username
- Type
string | null
- Description
TKTKTK
- Name
firstName
- Type
string | null
- Description
TKTKTK
- Name
lastName
- Type
string | null
- Description
TKTKTK
- Name
emailAddress
- Type
string | null
- Description
TKTKTK
- Name
phoneNumber
- Type
string | null
- Description
TKTKTK
- Name
web3Wallet
- Type
string | null
- Description
TKTKTK
- Name
hasPassword
- Type
boolean
- Description
TKTKTK
- Name
unsafeMetadata
- Type
SignUpUnsafeMetadata
- Description
TKTKTK
- Name
createdSessionId
- Type
string | null
- Description
TKTKTK
- Name
createdUserId
- Type
string | null
- Description
TKTKTK
- Name
abandonAt
- Type
number | null
- Description
TKTKTK
- Name
legalAcceptedAt
- Type
number | null
- Description
TKTKTK
function create(params: SignUpFutureCreateParams): Promise<{ error: unknown }>
SignUpFutureCreateParams
TKTKTK
- Name
emailAddress?
- Type
string
- Description
TKTKTK
- Name
phoneNumber?
- Type
string
- Description
TKTKTK
- Name
username?
- Type
string
- Description
TKTKTK
- Name
transfer?
- Type
boolean
- Description
TKTKTK
- Name
ticket?
- Type
string
- Description
TKTKTK
- Name
web3Wallet?
- Type
string
- Description
TKTKTK
- Name
firstName?
- Type
string
- Description
TKTKTK
- Name
lastName?
- Type
string
- Description
TKTKTK
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
TKTKTK
- Name
legalAccepted?
- Type
boolean
- Description
TKTKTK
update()
TKTKTK
function update(params: SignUpFutureUpdateParams): Promise<{ error: unknown }>
SignUpFutureUpdateParams
TKTKTK
- Name
firstName?
- Type
string
- Description
TKTKTK
- Name
lastName?
- Type
string
- Description
TKTKTK
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
TKTKTK
- Name
legalAccepted?
- Type
boolean
- Description
TKTKTK
verifications.sendEmailCode()
Used to send an email code to verify an email address.
function sendEmailCode(): Promise<{ error: unknown }>
verifications.verifyEmailCode()
Used to verify a code sent via email.
function verifyEmailCode(params: SignUpFutureEmailCodeVerifyParams): Promise<{ error: unknown }>
- Name
code
- Type
string
- Description
TKTKTK
verifications.sendPhoneCode()
Used to send a phone code to verify a phone number.
function sendPhoneCode(params: SignUpFuturePhoneCodeSendParams): Promise<{ error: unknown }>
- Name
phoneNumber?
- Type
string
- Description
TKTKTK
- Name
channel?
- Type
PhoneCodeChannel
- Description
TKTKTK
verifications.verifyPhoneCode()
Used to verify a code sent via phone.
function verifyPhoneCode(params: SignUpFuturePhoneCodeVerifyParams): Promise<{ error: unknown }>
- Name
code
- Type
string
- Description
TKTKTK
password()
Used to sign up using an email address and password.
function password(params: SignUpFuturePasswordParams): Promise<{ error: unknown }>
SignUpFuturePasswordParams
TKTKTK
Must include password
and exactly one of emailAddress
, phoneNumber
, or username
. You can also provide additional optional fields.
- Name
password
- Type
string
- Description
TKTKTK
- Name
emailAddress?
- Type
string
- Description
TKTKTK
- Name
phoneNumber?
- Type
string
- Description
TKTKTK
- Name
username?
- Type
string
- Description
TKTKTK
- Name
firstName?
- Type
string
- Description
TKTKTK
- Name
lastName?
- Type
string
- Description
TKTKTK
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
TKTKTK
- Name
legalAccepted?
- Type
boolean
- Description
TKTKTK
sso()
Used to create an account using an OAuth connection.
function sso(params: SignUpFutureSSOParams): Promise<{ error: unknown }>
SignUpFutureSSOParams
TKTKTK
- Name
strategy
- Type
string
- Description
TKTKTK
- Name
redirectUrl
- Type
string
- Description
The URL to redirect to after the user has completed the SSO flow.
- Name
redirectCallbackUrl
- Type
string
- Description
TODO @revamp-hooks: This should be handled by FAPI instead.
ticket()
Used to perform a ticket-based sign-up.
function ticket(params?: SignUpFutureTicketParams): Promise<{ error: unknown }>
SignUpFutureTicketParams
TKTKTK
- Name
ticket
- Type
string
- Description
TKTKTK
- Name
firstName?
- Type
string
- Description
TKTKTK
- Name
lastName?
- Type
string
- Description
TKTKTK
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
TKTKTK
- Name
legalAccepted?
- Type
boolean
- Description
TKTKTK
web3()
Used to perform a Web3-based sign-up.
function web3(params: SignUpFutureWeb3Params): Promise<{ error: unknown }>
SignUpFutureWeb3Params
TKTKTK
- Name
strategy
- Type
Web3Strategy
- Description
TKTKTK
- Name
unsafeMetadata?
- Type
SignUpUnsafeMetadata
- Description
TKTKTK
- Name
legalAccepted?
- Type
boolean
- Description
TKTKTK
finalize()
Used to convert a sign-up with status === 'complete'
into an active session. Will cause anything observing the session state (such as the useUser()
hook) to update automatically.
function finalize(params?: SignUpFutureFinalizeParams): Promise<{ error: unknown }>
SignUpFutureFinalizeParams
TKTKTK
- Name
navigate?
- Type
SetActiveNavigate
- Description
TKTKTK
- Name
sessionId
- Type
string
- Description
TKTKTK
Feedback
Last updated on