Using an unlinked account again
Unlinking removes the association between a login method and a Privy user. It does not block that login method from being used again in the app. When email-based account merging is enabled, Privy uses email addresses to match email, Google, and Apple accounts. When a user logs in again with an unlinked account, Privy checks whether its email matches an account still linked to an existing user. If it does, Privy re-adds the removed account and logs in that user. Otherwise, logging in with the removed identity creates a separate user when signups are allowed. In login-only mode (no-signup), the request fails instead.
The React SDK supports unlinking all supported account types via dedicated hooks.
To prompt a user to unlink an account, use the corresponding hook:Below is an example button for prompting a user to unlink certain linked accounts:
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.
Unlinking OAuth accounts
TheuseUnlinkOAuth hook supports unlinking any OAuth provider, including built-in providers (e.g., 'google', 'twitter') and additional OAuth providers (e.g., 'custom:twitch').Parameters
Theunlink 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.
