Skip to main content
Developers can use Privy to unlink users’ linked accounts (such as a wallet or Discord profile) at any point in their user journey. This might be useful whenever the user has either created a new external account (such as a new Twitter profile or email address) and want to remove the old linked account from their user.
The React SDK supports unlinking all supported account types via dedicated hooks. To prompt a user to unlink an account, use the corresponding hook:Each hook returns an unlink method that accepts an object with the relevant identifier.
Users are only permitted to unlink an account so long as they have at least one more linked account.
Below is an example button for prompting a user to unlink certain linked accounts:

Unlinking OAuth accounts

The useUnlinkOAuth hook supports unlinking any OAuth provider, including built-in providers (e.g., 'google', 'twitter') and additional OAuth providers (e.g., 'custom:twitch').

Parameters

The unlink method from useUnlinkOAuth accepts an object with the following fields:
string
required
The OAuth provider to unlink. Use a built-in provider (e.g., 'google', 'twitter') or a custom provider in the format 'custom:<provider-name>' (e.g., 'custom:twitch').
string
required
The provider-specific subject identifier that uniquely identifies the user for the selected OAuth provider. This can be found in the linked account’s subject field.