Skip to content
Torii docs

Key Hooks

Most apps only ever need one hook: useAuth(). It exposes the signed-in state, the current user, a token accessor, and sign-out. Add useAuthFetch() when you call your own backend. Everything else is specialized; reach for it only when you build custom account UI beyond the drop-in components.

HookWhat it’s for
useAuth()The primary hook: isSignedIn, user, getToken(), signOut(), and the active language. Start here.
useAuthFetch()A fetch wrapper that attaches the bearer token and retries once on a 401. Use it for requests to your own API.

These back the account widgets; use them directly only when you’re building bespoke account screens: