Skip to main content

useRevokeSessionKey

Revoke a session key (or signer) on the smart wallet account.

const Component = () => {
const { mutate: revokeSessionKey, isLoading, error } = useRevokeSessionKey();

if (error) {
console.error("failed to revoke session key", error);
}

return (
<button disabled={isLoading} onClick={() => revokeSessionKey(keyAddress)}>
Revoke Session Key
</button>
);
};

Usage

Provide the smart wallet account contract address as the argument.

import { useAccountAdminsAndSigners } from "@thirdweb-dev/react";

// Your ERC20 token smart contract address
const keyAddress = "{{key_address}}";

const Component = () => {
const { mutate: revokeSessionKey, isLoading, error } = useRevokeSessionKey();

if (error) {
console.error("failed to revoke session key", error);
}

return (
<button disabled={isLoading} onClick={() => revokeSessionKey(keyAddress)}>
Revoke Session Key
</button>
);
};

Configuration

keyAddress

keyAddress

The address to remove as an admin.