Documentation Index
Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
Use this file to discover all available pages before exploring further.
The useLogout hook provides functionality to log out the current user and optionally clear pregenerated wallets.
Import
import { useLogout } from "@getpara/react-sdk";
Usage
function LogoutButton() {
const { logout, logoutAsync, isPending } = useLogout();
const { data: account } = useAccount();
const handleLogout = async () => {
try {
await logoutAsync({
clearPregenWallets: false // Keep pregenerated wallets
});
console.log("Successfully logged out");
} catch (err) {
console.error("Logout failed:", err);
}
};
if (!account?.isConnected) {
return null;
}
return (
<button
onClick={handleLogout}
disabled={isPending}
>
{isPending ? "Logging out..." : "Logout"}
</button>
);
}