Docs

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 and is not directly accessible from the Frontend API.

Properties

  • Name
    id
    Type
    string
    Description

    A unique identifier for the user.

  • Name
    passwordEnabled
    Type
    boolean
    Description

    A boolean indicating whether the user has a password on their account.

  • Name
    totpEnabled
    Type
    boolean
    Description

    A boolean indicating whether the user has enabled TOTP by generating a TOTP secret and verifying it via an authenticator app

  • Name
    backupCodeEnabled
    Type
    boolean
    Description

    A boolean indicating whether the user has enabled Backup codes.

  • Name
    twoFactorEnabled
    Type
    boolean
    Description

    A boolean indicating whether the user has enabled two-factor authentication.

  • Name
    banned
    Type
    boolean
    Description

    A boolean indicating whether the user is banned or not.

  • Name
    createdAt
    Type
    number
    Description

    Date when the user was first created.

  • Name
    updatedAt
    Type
    number
    Description

    Date of the last time the user was updated.

  • Name
    imageUrl
    Type
    string
    Description

    The URL of the user's profile image.

  • Name
    hasImage
    Type
    boolean
    Description

    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.

  • Name
    primaryEmailAddressId
    Type
    string
    Description

    The unique identifier for the EmailAddress that the user has set as primary.

  • Name
    primaryPhoneNumberId
    Type
    string
    Description

    The unique identifier for the PhoneNumber that the user has set as primary.

  • Name
    primaryWeb3WalletId
    Type
    string
    Description

    The unique identifier for the Web3Wallet that the user signed up with.

  • Name
    lastSignInAt
    Type
    number
    Description

    Date when the user last signed in. May be empty if the user has never signed in.

  • Name
    externalId
    Type
    string
    Description

    The unique identifier for the user in the external system.

  • Name
    username
    Type
    string
    Description

    The user's username.

  • Name
    firstName
    Type
    string
    Description

    The user's first name.

  • Name
    lastName
    Type
    string
    Description

    The user's last name.

  • Name
    publicMetadata
    Type
    {[string]: any}
    Description

    Metadata that can be read from the Frontend API and Backend API and can be set only from the Backend API.

  • Name
    privateMetadata
    Type
    {[string]: any}
    Description

    Metadata that can be read and set only from the Backend API.

  • Name
    unsafeMetadata
    Type
    {[string]: any}
    Description

    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.

  • Name
    emailAddresses
    Type
    EmailAddress[]
    Description

    An array of all the EmailAddress objects associated with the user. Includes the primary.

  • Name
    phoneNumbers
    Type
    PhoneNumber[]
    Description

    An array of all the PhoneNumber objects associated with the user. Includes the primary.

  • Name
    hasVerifiedPhoneNumber
    Type
    boolean
    Description

    A getter boolean to check if the user has verified a phone number.

  • Name
    web3Wallets
    Type
    Web3Wallet[]
    Description

    An array of all the Web3Wallet objects associated with the user. Includes the primary.

  • Name
    externalAccounts
    Type
    ExternalAccount[]
    Description

    An array of all the ExternalAccount objects associated with the user via OAuth.
    Note: This includes both verified & unverified external accounts.

  • Name
    lastActiveAt
    Type
    number
    Description

    Date when the user was last active.

  • Name
    createOrganizationEnabled
    Type
    boolean
    Description

    A boolean indicating whether the organization creation is enabled for the user or not.

  • Name
    createOrganizationsLimit?
    Type
    number
    Description

    An integer indicating the number of organizations that can be created by the user. If the value is 0, then the user can create unlimited organizations. Default is null.

Feedback

What did you think of this content?

Last updated on