try/catch.
useSession
Session state, kept current by push events.useAuth
Stable async actions wrapping the bindings.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 RouterclientLoader, 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.
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 onIDENTITIES_CHANGED.
usePasskeys
Device capability plus the credential list. Probes capability on mount without touching the network, loads the list when signed in, refreshes onPASSKEYS_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.
