Skip to content

Unlinking accounts

Once a user has linked additional accounts to their profile, you may also want to give them the option to unlink those accounts.

Use the methods returned by the following hooks to unlink a given account from a user:

Unlinking deletes the account from the underlying user object, meaning the user can no longer sign-in to your app with that account. Note that embedded wallets cannot be unlinked from a user's account.

INFO

Each unlink- method accepts an object to determine which account to unlink. For example, to unlink an external wallet, you would call unlinkWallet({ address: wallet.address }).

Below is an example button for prompting a user to unlink a wallet from their account:

tsx
import {useUnlinkWallet} from '@privy-io/expo';

export function WalletScreen() {
  const {unlinkWallet} = useUnlinkWallet();

  return (
    <View>
      <Text>Wallet: {wallet.address}</Text>
      <Button onPress={() => unlinkWallet({address: wallet.address})}>Unlink Wallet</Button>
    </View>
  );
}

WARNING

Every user must have at least one account linked to their profile that is not an embedded wallet.


Accordingly, if a user has only one account linked that is not an embedded wallet, it cannot be unlinked from their profile unless they link a second account.