useRevokeSessionKey

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

Example

import { useRevokeSessionKey } 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>
);
};

Returns

Mutation object to revoke a session key (or signer) on the smart wallet

const { mutateAsync, isLoading, error } = useRevokeSessionKey();

The mutation function takes an address of type string to remove as an admin.