User

The User object contains the user's account information.

Attributes

Name

Description

id

string

A unique identifier for the user.

firstName

string | null

The user's first name.

lastName

string | null

The user's last name.

fullName

string | null

The user's full name.

username

string | null

The user's username.

profileImageUrl

string | null

A url with the user's profile image.

primaryEmailAddress

EmailAddress | null

The EmailAddress object that the user has set as primary.

primaryEmailAddressId

string | null

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

emailAddresses

EmailAddress[]

Any array of all the EmailAddress objects associated with the user.

primaryPhoneNumber

PhoneNumber | null

The PhoneNumber object that the user has set as primary.

primaryPhoneNumberId

string | null

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

phoneNumbers

PhoneNumber[]

Any array of all the PhoneNumber objects associated with the user.

externalAccounts

ExternalAccount[]

Any array of all the ExternalAccount objects associated with the user with OAuth.

passwordEnabled

boolean

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

publicMetadata

{[string]: any} | null

Metadata that can be read from the Frontend and Backend API 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.

Functions

getToken

Arguments
Return
Arguments

Name

Description

integration

string

A string representing the integration. Currently, the only option is hasura.

Return

Returns a promise that resolves to a token.

Retrieve the user's token for the given integration. This method uses a cache so a network request will only be made if the token in memory has expired. The TTL for each token is one minute.