useUser
Hook for retrieving information about the currently signed in user using auth.
Useful to get the user's address and session data, or undefined
if no user is signed in.
import { useUser } from "@thirdweb-dev/react";
Usage
Call the useUser
hook to get the information about the currently signed in wallet.
import { useUser, Web3Button } from "@thirdweb-dev/react";
function App() {
const { user, isLoggedIn, isLoading } = useUser();
}
Return Value
{
user: {
address: string;
session?: Json;
} | undefined;
isLoggedIn: boolean;
isLoading: boolean;
}