Developers can use Privy to prompt users to unlink their 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 our modal-guided link methods. To prompt a user to unlink an account, use the respective method from the usePrivy hook:

MethodDescription
unlinkEmailunlinks email address
unlinkPhoneunlinks phone number
unlinkWalletunlinks external wallet
unlinkGoogleunlinks Google account
unlinkAppleunlinks Apple account
unlinkTwitterunlinks Twitter account
unlinkDiscordunlinks Discord account
unlinkGithubunlinks Github account
unlinklinkedInunlinks LinkedIn account
unlinkTikTokunlinks TikTok account
unlinkSpotifyunlinks Spotify account
unlinkInstagramunlinks Instagram account
unlinkTelegramunlinks Telegram account
unlinkFarcasterunlinks Farcaster account
unlinkPasskeyunlinks passkey

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:

import {usePrivy} from '@privy-io/react-auth';

function LinkOptions() {
const {unlinkEmail, unlinkGoogle, unlinkWallet} = usePrivy();

return (
<div className="unlink-options">
<button onClick={unlinkEmail}>Unlink Email to user</button>
<button onClick={unlinkGoogle}>Unlink Google account to user</button>
<button onClick={unlinkWallet}>Unlink Wallet to user</button>
</div>
);
}