Show connected provider accounts
Account settings
Clerk · Class
ExternalAccount represents a verified identity supplied by an external provider such as Google. It exposes provider metadata, granted scopes, account identifiers, and methods to reauthorize or delete the connection.
ExternalAccount represents a verified identity obtained through an external provider. It exposes provider and account details, verification-related state, and operations for reauthorizing or deleting the connected account.
function reauthorize(params: ReauthorizeExternalAccountParams): Promise<ExternalAccount>| Name | Type | Description |
|---|---|---|
params | ReauthorizeExternalAccountParams | Parameters required to reauthorize the existing external account. |
reauthorize(params: ReauthorizeExternalAccountParams): Promise<ExternalAccount>; destroy() deletes the external account.
const account = user.externalAccounts[0];
console.log(account.providerTitle());
console.log(account.accountIdentifier());
await account.reauthorize({});
await account.destroy();Uses an existing external account from a Clerk User, displays provider-derived labels, then demonstrates reauthorization and deletion.
Account settings
Authorization maintenance
Account cleanup
ExternalAccount models an identity obtained from an external provider such as Google. It must be verified, and the object retains the state needed for that verification process.
Follow-up: How would you identify the account for display? Use accountIdentifier(), which prefers username and falls back to emailAddress.
reauthorize() starts a new authorization flow for an existing external account and returns a Promise<ExternalAccount>. It accepts ReauthorizeExternalAccountParams.
Follow-up: What operation removes the connection? Call destroy() on the external-account instance.
providerTitle() returns the provider name with “Account” appended, while accountIdentifier() returns a useful username-or-email identifier. These methods provide display-oriented values without manually formatting the raw properties.
Follow-up: What provider-specific value is available? providerUserId contains the user's unique ID at the external provider.
User.externalAccountsVerificationResourceReauthorizeExternalAccountParamscreateExternalAccount()