Package-level declarations

Types

Link copied to clipboard
@Serializable
data class User(val backupCodeEnabled: Boolean? = null, val createdAt: Long? = null, val createOrganizationEnabled: Boolean? = null, val createOrganizationsLimit: Int? = null, val deleteSelfEnabled: Boolean = false, val emailAddresses: List<EmailAddress>, val enterpriseAccounts: List<EnterpriseAccount>? = null, val externalAccounts: List<ExternalAccount>, val firstName: String? = null, val hasImage: Boolean, val id: String, val imageUrl: String, val lastSignInAt: Long? = null, val lastName: String? = null, val legalAcceptedAt: Long? = null, val organizationMemberships: List<OrganizationMembership>? = null, val passkeys: List<Passkey>, val passwordEnabled: Boolean, val phoneNumbers: List<PhoneNumber>, val primaryEmailAddressId: String? = null, val primaryPhoneNumberId: String? = null, val publicMetadata: JsonObject? = null, val privateMetadata: JsonObject? = null, val totpEnabled: Boolean, val twoFactorEnabled: Boolean, val updatedAt: Long, val unsafeMetadata: JsonObject? = null, val username: String? = null)

The User object holds all of the information for a single user of your application and provides a set of methods to manage their account.

Properties

Link copied to clipboard

Extension property that returns a list of OAuth providers that the user has not yet connected.

Functions

Link copied to clipboard

Retrieves the active sessions for the current user or the user with the given session ID.

Link copied to clipboard

Retrieves all sessions for the current user or the user with the given session ID.

Link copied to clipboard

Verifies a TOTP (Time-based One-Time Password) code to complete the TOTP setup process.

Link copied to clipboard

Generates backup codes for the current user's account.

Link copied to clipboard

Creates a new email address for the current user or the user with the given session ID.

Link copied to clipboard

Adds an external account for the user. A new ExternalAccount will be created and associated with the user. This method is useful if you want to allow an already signed-in user to connect their account with an external provider, such as Facebook, GitHub, etc., so that they can sign in with that provider in the future.

Link copied to clipboard

Creates a new passkey for the current user or the user with the given session ID.

Link copied to clipboard

Creates a new phone number for the current user or the user with the given session ID.

Link copied to clipboard

Creates a new TOTP (Time-based One-Time Password) configuration for the current user.

Link copied to clipboard

Deletes the current user, or the user with the given session ID, from the Clerk API.

Link copied to clipboard
suspend fun User.deletePassword(currentPassword: String): ClerkResult<User, ClerkErrorResponse>

Deletes the current user's password, or the user with the given session ID, using the Clerk API.

Link copied to clipboard

Deletes the current user's profile image, or the user with the given session ID, from the Clerk API.

Link copied to clipboard

Deletes the TOTP (Time-based One-Time Password) configuration for the current user.

Link copied to clipboard

Retrieves all email addresses associated with the current user or the user with the given session ID.

Link copied to clipboard

Extension function that returns the user's full name by combining first and last names.

Link copied to clipboard

Retrieves the current user, or the user with the given session ID, from the Clerk API.

Link copied to clipboard

Retrieves all phone numbers associated with the current user or the user with the given session ID.

Link copied to clipboard

Update the current user's profile image, or the user with the given session ID, with the provided image data.

Link copied to clipboard

Updates the current user, or the user with the given session ID, with the provided parameters.

Link copied to clipboard

Updates the current user's password, or the user with the given session ID, using the Clerk API.