SignUp
The SignUp
object holds the state of the current sign-up and provides helper methods to navigate and complete the sign-up process. Once a sign-up is complete, a new user is created.
The Sign-Up Process:
Initiate the Sign-Up: Begin the sign-up process by collecting the user's authentication information and passing the appropriate parameters to the
create()
method.Prepare the Verification: The system will prepare the necessary verification steps to confirm the user's information.
Complete the Verification: Attempt to complete the verification by following the required steps based on the collected authentication data.
Sign Up Complete: If the verification is successful, the newly created session is set as the active session.
Constructors
Types
Defines the possible strategies for attempting verification during the sign-up process. This sealed interface encapsulates the different types of verification attempts, such as email or phone code verification.
Defines the parameters for authenticating with redirect-based flows. This sealed interface supports OAuth and Enterprise SSO authentication methods.
Represents the various strategies for initiating a SignUp
request. This sealed interface encapsulates the different ways to create a sign-up, such as using standard parameters (e.g., email, password) or creating without any parameters to inspect the signUp object first.
Contains parameters for preparing verification during the sign-up process. Use these strategies to initiate verification for email addresses or phone numbers.
Parameters for updating an existing sign-up with additional information. These parameters mirror the create parameters and allow modification of sign-up data.
Represents the current status of the sign-up process.
Properties
The date when the sign-up was abandoned by the user.
The identifier of the newly-created session. This attribute is populated only when the sign-up is complete.
The identifier of the newly-created user. This attribute is populated only when the sign-up is complete.
The email address supplied to the current sign-up. Only supported if email address is enabled in the instance settings.
An array of all the fields whose values are not supplied yet but they are mandatory in order for a sign-up to be marked as complete.
An array of all the fields that can be supplied to the sign-up, but their absence does not prevent the sign-up from being marked as complete.
The value of this attribute is true if a password was supplied to the current sign-up. Only supported if password is enabled in the instance settings.
The user's phone number in E.164 format. Only supported if phone number is enabled in the instance settings.
An array of all the required fields that need to be supplied and verified in order for this sign-up to be marked as complete and converted into a user.
The status of the current sign-up. Indicates the current state of the sign-up process (e.g., complete, missing requirements, etc.).
Metadata that can be read and set from the frontend. Once the sign-up is complete, the value of this field will be automatically copied to the newly created user's unsafe metadata. One common use case for this attribute is to use it to implement custom fields that can be collected during sign-up and will automatically be attached to the created User object.
An array of all the fields whose values have been supplied, but they need additional verification in order for them to be accepted.
An object that contains information about all the verifications that are in-flight.
Functions
Attempts to complete the in-flight verification process that corresponds to the given strategy. In order to use this method, you should first initiate a verification process by calling SignUp.prepareVerification.
The prepareVerification method is used to initiate the verification process for a field that requires it.
The update method is used to update the sign-up process with new information. This can be used to add additional fields to the sign-up process, such as a phone number or an email address.