Skip to main content
Once a wallet has signers, they may also revoke consent to prevent your app from taking any further wallet actions on their behalf.
To remove all the signers on the wallet, use the removeSigners method from the useSigners hook:
removeSigners: async ({address: string}) => Promise<{user: User}>

Usage

import {useSigners} from '@privy-io/react-auth';
...
const {removeSigners} = useSigners();
When invoked, the removeSigners method will remove all the signers, so only the user can transact on the wallet.
After this action, your app will no longer be able to take actions on behalf of the user with their wallet unless the user adds more session signers.
Check out the starter repo for an end to end example of how to use signers.

Parameters

The removeSigners method accepts a params object with the following fields:
address
string
required
Address of the embedded wallet to delegate.
As an example, you might have a button within your app to allow users to remove all signers like so:
Example remove signers button
import {usePrivy, useSigners, type WalletWithMetadata} from '@privy-io/react-auth';

function RemoveSessionSignersButton() {
  const {user} = usePrivy();
  const {removeSigners} = useSigners();

  // Check if the user's wallets already has signers by searching the linkedAccounts array for wallets
  // with `delegated: true` set
  const delegatedWallet = user.linkedAccounts.filter(
    (account): account is WalletWithMetadata => account.type === 'wallet' && account.delegated
  );

  const onRevoke = async () => {
    if (!hasDelegatedWallets) return; // Button is disabled to prevent this case
    await removeSigners({address: delegatedWallet.address});
  };

  return (
    <button disabled={!hasDelegatedWallets} onClick={onRevoke}>
      Revoke permission for this app to transact on my behalf
    </button>
  );
}