Skip to content

UseAuthClient

useAuthClient(options?): object

Defined in: use-auth-client.ts:63

React hook to set up the Internet Computer auth client

UseAuthClientOptions

configuration for the hook

actor: undefined | null | ActorSubclass

actors: Record<string, ActorSubclass>

authClient: null | AuthClient

identity: null | Identity

isAuthenticated: boolean

login: () => Promise<void | InternetIdentityAuthResponseSuccess>

Login through your configured identity provider Wraps the onSuccess and onError callbacks with promises for convenience

Promise<void | InternetIdentityAuthResponseSuccess>

Returns a promise that resolves to the response from the identity provider

logout: () => Promise<void>

Promise<void>

UseAuthClientOptions