SignUp

@Serializable
data class SignUp(val id: String, val status: SignUp.Status, val requiredFields: List<String>, val optionalFields: List<String>, val missingFields: List<String>, val unverifiedFields: List<String>, val verifications: Map<String, Verification?>, val username: String? = null, val emailAddress: String? = null, val phoneNumber: String? = null, val passwordEnabled: Boolean, val firstName: String? = null, val lastName: String? = null, val unsafeMetadata: JsonObject? = null, val createdSessionId: String? = null, val createdUserId: String? = null, val abandonedAt: Long? = null)

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:

  1. 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.

  2. Prepare the Verification: The system will prepare the necessary verification steps to confirm the user's information.

  3. Complete the Verification: Attempt to complete the verification by following the required steps based on the collected authentication data.

  4. Sign Up Complete: If the verification is successful, the newly created session is set as the active session.

Constructors

Link copied to clipboard
constructor(id: String, status: SignUp.Status, requiredFields: List<String>, optionalFields: List<String>, missingFields: List<String>, unverifiedFields: List<String>, verifications: Map<String, Verification?>, username: String? = null, emailAddress: String? = null, phoneNumber: String? = null, passwordEnabled: Boolean, firstName: String? = null, lastName: String? = null, unsafeMetadata: JsonObject? = null, createdSessionId: String? = null, createdUserId: String? = null, abandonedAt: Long? = null)

Types

Link copied to clipboard
sealed interface AttemptVerificationParams

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.

Link copied to clipboard

Defines the parameters for authenticating with redirect-based flows. This sealed interface supports OAuth and Enterprise SSO authentication methods.

Link copied to clipboard
object Companion
Link copied to clipboard
sealed interface CreateParams

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.

Link copied to clipboard

Contains parameters for preparing verification during the sign-up process. Use these strategies to initiate verification for email addresses or phone numbers.

Link copied to clipboard
sealed interface SignUpUpdateParams

Parameters for updating an existing sign-up with additional information. These parameters mirror the create parameters and allow modification of sign-up data.

Link copied to clipboard
@Serializable
enum Status : Enum<SignUp.Status>

Represents the current status of the sign-up process.

Properties

Link copied to clipboard
@SerialName(value = "abandoned_at")
val abandonedAt: Long? = null

The date when the sign-up was abandoned by the user.

Link copied to clipboard
@SerialName(value = "created_session_id")
val createdSessionId: String? = null

The identifier of the newly-created session. This attribute is populated only when the sign-up is complete.

Link copied to clipboard
@SerialName(value = "created_user_id")
val createdUserId: String? = null

The identifier of the newly-created user. This attribute is populated only when the sign-up is complete.

Link copied to clipboard
@SerialName(value = "email_address")
val emailAddress: String? = null

The email address supplied to the current sign-up. Only supported if email address is enabled in the instance settings.

Link copied to clipboard
@SerialName(value = "first_name")
val firstName: String? = null

The first name supplied to the current sign-up. Only supported if name is enabled in the instance settings.

Link copied to clipboard
val id: String

The unique identifier of the current sign-up. This ID is used to track the sign-up process throughout its lifecycle.

Link copied to clipboard
@SerialName(value = "last_name")
val lastName: String? = null

The last name supplied to the current sign-up. Only supported if name is enabled in the instance settings.

Link copied to clipboard
@SerialName(value = "missing_fields")
val missingFields: List<String>

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.

Link copied to clipboard
@SerialName(value = "optional_fields")
val optionalFields: List<String>

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.

Link copied to clipboard
@SerialName(value = "password_enabled")
val passwordEnabled: Boolean

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.

Link copied to clipboard
@SerialName(value = "phone_number")
val phoneNumber: String? = null

The user's phone number in E.164 format. Only supported if phone number is enabled in the instance settings.

Link copied to clipboard
@SerialName(value = "required_fields")
val requiredFields: List<String>

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.

Link copied to clipboard

The status of the current sign-up. Indicates the current state of the sign-up process (e.g., complete, missing requirements, etc.).

Link copied to clipboard
@SerialName(value = "unsafe_metadata")
val unsafeMetadata: JsonObject? = null

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.

Link copied to clipboard
@SerialName(value = "unverified_fields")
val unverifiedFields: List<String>

An array of all the fields whose values have been supplied, but they need additional verification in order for them to be accepted.

Link copied to clipboard
val username: String? = null

The username supplied to the current sign-up. Only supported if username is enabled in the instance settings.

Link copied to clipboard

An object that contains information about all the verifications that are in-flight.

Functions

Link copied to clipboard

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.

Link copied to clipboard

The prepareVerification method is used to initiate the verification process for a field that requires it.

Link copied to clipboard

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.