Skip to Content
Clerk logo

Clerk Docs

Ctrl + K
Go to clerk.com

ExternalAccount

The ExternalAccount object is a model around an identification obtained by an external provider (e.g. an OAuth provider such as Google).

External account must be verified, so that you can make sure they can be assigned to their rightful owners. The ExternalAccount object holds all necessary state around the verification process.

Attributes

NameTypeDescription
idstringA unique identifier for this external account.
identificationIdstringThe identification with which this external account is associated.
providerstringThe provider name e.g. google
publicMetadataobjectMetadata provided about the user from the provider
providerUserIdstringThe unique ID of the user in the provider.
emailAddressstringThe provided email address of the user.
approvedScopesstring[]The scopes that the user has granted access to.
firstNamestringThe provided first name of the user.
lastNamestringThe provided last name of the user.
avatarUrlstringThe provided avatar URL of the user.
usernamestring | nullThe provided username of the user.
labelstring | nullA descriptive label to differentiate multiple external accounts of the same user for the same provider.
verificationVerificationAn object holding information on the verification of this external account.

Methods

reauthorize()

function reauthorize(params: ReauthorizeExternalAccountParams): Promise<ExternalAccount>;

Invoke a re-authorization flow for an existing external account.

ReauthorizeExternalAccountParams

NameTypeDescription
additionalScopesstring[] | undefinedAny additional scopes you would like your user to be prompted to approve.
redirectUrlstring | undefinedThe URL to redirect back to one the OAuth flow has completed successfully or unsuccessfully.

destroy()

function destroy(): Promise<void>;

Delete this external account.

providerSlug()

function providerSlug(): string;

A getter method for the provider attribute

providerTitle()

function providerTitle(): string;

The title of the provider with the word "Account" appended.

EG: google becomes Google Account

accountIdentifier()

function accountIdentifier(): string;

The identifier of the account, either the:

  • username if present
  • emailAddress if present
  • label

What did you think of this content?

Clerk © 2023