SDK Quickstarts
Quickstart — React SPA
@authaz/react is the client-side piece. It gives you AuthazProvider, hooks (useAuthaz, useUser, useLogin, useLogout), and route guards (ProtectedRoute, useRequireAuth).
It does not talk directly to Authaz — instead it talks to your backend, which mounts the OAuth handler. For a Hono backend that's @authaz/hono. For Express/Fastify/etc., proxy the same routes to the OAuth flow yourself, or run a tiny Hono app alongside your existing backend.
This quickstart assumes you have a backend at /api/auth/* already — the Hono quickstart sets that up in 5 minutes. The frontend code is the same regardless of backend.
Prerequisites#
- A React 18+ app (Vite, CRA, TanStack Start — any setup works).
- A backend serving the auth routes at
/api/auth/login, , , , . The Hono quickstart covers this end-to-end.