Skip to main content

useUser() function

This feature is currently in beta and may change based on feedback that we receive.

Hook to get the currently logged in user.

Signature:

export declare function useUser<
TData extends Json = Json,
TContext extends Json = Json,
>(): {
user: UserWithData<TData, TContext> | undefined;
isLoggedIn: boolean;
isLoading: boolean;
};

Returns:

{ user: UserWithData<TData, TContext> | undefined; isLoggedIn: boolean; isLoading: boolean; }

  • The currently logged in user or null if not logged in, as well as a loading state.