useLogout

Provides a hook to log out a user, disconnecting the signer and triggering the disconnectAsync function.

Import

1import { useLogout } from "@account-kit/react";

Usage

1import { useLogout } from "@account-kit/react";
2
3const { logout, isLoggingOut, error } = useLogout({
4 // these are optional
5 onSuccess: () => {
6 // do something on success
7 },
8 onError: (error) => console.error(error),
9});

Parameters

mutationArgs

UseLogoutMutationArgs optional arguments to customize the mutation behavior

Returns

UseLogoutResult an object containing the logout function, a boolean indicating if logout is in progress, and any error encountered during logout