Recipes
React SPA — first integration
← All recipes · First time? Set up your app (60 seconds — keys + redirect URI)
A React + Vite single-page app that signs a user in via Authaz Sign-In, gates pages with hooks, and uses <SignInButton> / <SignOutButton> components. Single-tenant, no roles. Pairs with a Hono backend (or any backend that runs the Authaz handler).
1. What you'll build#
A React SPA where / is public, /dashboard requires authentication, and the signed-in user's email appears in the navbar.
2. Application setup#
In the Authaz Dashboard:
- New application → name it, choose Single-tenant.
- Note the Client ID and Client Secret.
- Under Auth Flow Configuration, add
http://localhost:5173/auth/callbackas an allowed callback URL (Vite's default port).