useWalletLogout

useWalletLogout is a React Hook that lets you log out of the previously authenticated user. You have to be authenticated before calling logout.

const { execute, isPending } = useWalletLogout();

Reference

useWalletLogout

Call useWalletLogout in the component responsible to log out your users.

function LogoutButton() {
  const { execute: logout, isPending } = useWalletLogout();
  
  return (
      <button disabled={isPending} onClick={logout}>Log out</button>
  );
}

Parameters

useWalletLogout does not take any parameters.

Returns

Returns an object with:

  • execute: a function you can use to programmatically log out currently logged-in user.
  • isPending: a boolean notifying you when the operation is still in progress.