Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

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

NameTypeDescription
idstringA unique identifier for the user.
passwordEnabledbooleanA boolean indicating whether the user has a password on their account.
totpEnabledbooleanA boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator ap
backupCodeEnabledbooleanA boolean indicating whether the user has enabled Backup codes.
twoFactorEnabledbooleanA boolean indicating whether the user has enabled two-factor authentication.
bannedbooleanA boolean indicating whether the user is banned or not.
createdAtDateDate when the user was first created.
updatedAtDateDate of the last time the user was updated.
imageUrlstringThe URL of the user's profile image.
hasImagebooleanA 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.
primaryEmailAddressIdstring | nullThe unique identifier for the EmailAddress that the user has set as primary.
primaryPhoneNumberIdstring | nullThe unique identifier for the PhoneNumber that the user has set as primary.
primaryWeb3WalletIdstring | nullThe unique identifier for the Web3Wallet that the user signed up with.
lastSignInAtDateDate when the user last signed in. May be empty if the user has never signed in.
externalIdstring | nullThe unique identifier for the user in the external system.
usernamestring | nullThe user's username.
firstNamestring | nullThe user's first name.
lastNamestring | nullThe user's last name.
publicMetadata{[string]: any} | nullMetadata 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} | nullMetadata that can be read and set only from the Backend API(opens in a new tab).
unsafeMetadata{[string]: any} | nullMetadata 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.
emailAddressesEmailAddress[]An array of all the EmailAddress objects associated with the user. Includes the primary.
phoneNumbersPhoneNumber[]An array of all the PhoneNumber objects associated with the user. Includes the primary.
hasVerifiedPhoneNumberbooleanA getter boolean to check if the user has verified a phone number.
web3WalletsWeb3Wallet[]An array of all the Web3Wallet objects associated with the user. Includes the primary.
externalAccountsExternalAccount[]An array of all the ExternalAccount objects associated with the user via OAuth.
Note: This includes both verified & unverified external accounts.
lastActiveAtDateDate when the user was last active.
createOrganizationEnabledbooleanA boolean indicating whether the organization creation is enabled for the user or not.

Last updated on March 7, 2024

What did you think of this content?

Clerk © 2024