Skip to main content
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

    The 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

    The date when the user was first created.

  • Name
    updatedAt
    Type
    number
    Description

    The date when the user was last 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 ID for the EmailAddress that the user has set as primary.

  • Name
    primaryPhoneNumberId
    Type
    string
    Description

    The ID for the PhoneNumber that the user has set as primary.

  • Name
    primaryWeb3WalletId
    Type
    string
    Description

    The ID for the Web3Wallet that the user signed up with.

  • Name
    lastSignInAt
    Type
    number
    Description

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

  • Name
    externalId
    Type
    string
    Description

    The ID of the user as used in your external systems. Must be unique across your instance.

  • 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
    UserPublicMetadata
    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
    UserPrivateMetadata
    Description

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

  • Name
    unsafeMetadata
    Type
    UserUnsafeMetadata
    Description

    Metadata that can be read and set from the Frontend API. It's considered unsafe because it can be modified from the frontend.

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

  • Name
    legalAcceptedAt?
    Type
    number | null
    Description

    The unix timestamp of when the user accepted the legal requirements. null if Require express consent to legal documents is not enabled.

Feedback

What did you think of this content?

Last updated on