The Backend User
object
The Backend User
object is similar to the User
object as it holds information about a user of your application, such as their unique identifier, name, email addresses, phone numbers, and more. However, the Backend User
object is different from the User
object in that it is used in the Backend API(opens in a new tab) and is not directly accessible from the Frontend API.
Properties
Name | Type | Description |
---|---|---|
id | string | A unique identifier for the user. |
passwordEnabled | boolean | A boolean indicating whether the user has a password on their account. |
totpEnabled | boolean | A boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator ap |
backupCodeEnabled | boolean | A boolean indicating whether the user has enabled Backup codes. |
twoFactorEnabled | boolean | A boolean indicating whether the user has enabled two-factor authentication. |
banned | boolean | A boolean indicating whether the user is banned or not. |
createdAt | Date | Date when the user was first created. |
updatedAt | Date | Date of the last time the user was updated. |
imageUrl | string | The URL of the user's profile image. |
hasImage | boolean | A getter boolean to check if the user has uploaded an image or one was copied from OAuth. Returns false if Clerk is displaying an avatar for the user. |
primaryEmailAddressId | string | null | The unique identifier for the EmailAddress that the user has set as primary. |
primaryPhoneNumberId | string | null | The unique identifier for the PhoneNumber that the user has set as primary. |
primaryWeb3WalletId | string | null | The unique identifier for the Web3Wallet that the user signed up with. |
lastSignInAt | Date | Date when the user last signed in. May be empty if the user has never signed in. |
externalId | string | null | The unique identifier for the user in the external system. |
username | string | null | The user's username. |
firstName | string | null | The user's first name. |
lastName | string | null | The user's last name. |
publicMetadata | {[string]: any} | null | Metadata that can be read from the Frontend API and Backend API(opens in a new tab) and can be set only from the Backend API . |
privateMetadata | {[string]: any} | null | Metadata that can be read and set only from the Backend API(opens in a new tab). |
unsafeMetadata | {[string]: any} | null | Metadata that can be read and set from the Frontend API. One common use case for this attribute is to implement custom fields that will be attached to the User object.Please note that there is also an unsafeMetadata attribute in the SignUp object. The value of that field will be automatically copied to the user's unsafe metadata once the sign up is complete. |
emailAddresses | EmailAddress[] | An array of all the EmailAddress objects associated with the user. Includes the primary. |
phoneNumbers | PhoneNumber[] | An array of all the PhoneNumber objects associated with the user. Includes the primary. |
hasVerifiedPhoneNumber | boolean | A getter boolean to check if the user has verified a phone number. |
web3Wallets | Web3Wallet[] | An array of all the Web3Wallet objects associated with the user. Includes the primary. |
externalAccounts | ExternalAccount[] | An array of all the ExternalAccount objects associated with the user via OAuth.Note: This includes both verified & unverified external accounts. |
lastActiveAt | Date | Date when the user was last active. |
createOrganizationEnabled | boolean | A boolean indicating whether the organization creation is enabled for the user or not. |
Last updated on March 7, 2024