Skip to main content
Every hook talks to the plugin bindings directly. There is no provider to mount and no shared store to configure. Actions never throw. They resolve to a discriminated result, so a failed call is a branch rather than a try/catch.

useSession

Session state, kept current by push events.

useAuth

Stable async actions wrapping the bindings.
Non-AuthError failures are folded into kind: "unknown", so result.error is always the structured shape. The returned object is a module-scope constant — the same reference in every component, on every render — so it is safe in a dependency array.

authActions and getSession

Router guards run before anything mounts: a React Router clientLoader, a TanStack Router beforeLoad, a Next.js middleware. A hook cannot be called there, so the same actions useAuth() returns are also exported directly, alongside the read side.
getSession is the raw binding, not an AuthResult action. A network failure rejects rather than resolving to null, so catch it — otherwise a blip escapes your guard instead of redirecting to sign-in. useSession() already folds that case into status: "signedOut".
The package entry pulls React into the module graph whichever export you reach for. These exist for guards in a React app, not for a React-free runtime.

useIdentities

The identity list for the signed-in account. Loads on mount, refreshes on IDENTITIES_CHANGED.
Needs the identity permissions.

usePasskeys

Device capability plus the credential list. Probes capability on mount without touching the network, loads the list when signed in, refreshes on PASSKEYS_CHANGED.

useOnboarding

Where a signed-in user stands in a declared onboarding configuration.
incomplete means present your onboarding screens; complete means never show them again. Use it to decide whether to route an existing user back into onboarding after sign-in.

useOnboardingFlow

The full state machine behind <OnboardingFlow />, for a custom funnel.
Actions: submitCredentials({ email, password }), submitCode(code), resendCode(), editEmail(), submitStep(values), goBack(), and signInInstead({ email, password }?). onComplete fires exactly once, only after the final status write succeeds. It receives { user, profile }, where profile holds the values collected during this mount and is empty on an already-complete resume. While waiting on email confirmation the hook re-checks on an interval, so the funnel advances on its own once the user confirms in another window. Both onboarding hooks need allow-update-user.