auth0-react
Authentication for React SPAs using Auth0 Universal Login with redirect-based flows.
- Supports React 16–19 with Vite or Create React App; wraps your app with
Auth0Providerand exposes hooks likeuseAuth0(),loginWithRedirect(), andlogout() - Handles user sessions, access tokens, and profile data automatically; SDK manages secure token storage without manual localStorage handling
- Includes protected routes, API token injection, and error handling patterns documented in the integration guide
- Not suitable for Next.js, React Native, server-side rendering, or embedded login flows; use framework-specific skills instead
Auth0 React Integration
Add authentication to React single-page applications using @auth0/auth0-react.
Prerequisites
- React 16.11+ application (Vite or Create React App) - supports React 16, 17, 18, and 19
- Auth0 account and application configured
- If you don't have Auth0 set up yet, use the
auth0-quickstartskill first
When NOT to Use
- Next.js applications - Use
auth0-nextjsskill for both App Router and Pages Router - React Native mobile apps - Use
auth0-react-nativeskill for iOS/Android - Server-side rendered React - Use framework-specific SDK (Next.js, Remix, etc.)
- Embedded login - This SDK uses Auth0 Universal Login (redirect-based)
- Backend API authentication - Use express-openid-connect or JWT validation instead
More from auth0/agent-skills
auth0-quickstart
Use when adding authentication or login to any app - detects your stack (React, Next.js, Vue, Nuxt, Angular, Express, Fastify, FastAPI, ASP.NET Core, React Native, Expo, Android, Swift), sets up an Auth0 account if needed, and routes to the correct SDK setup workflow.
1.5Kauth0-nextjs
Use when adding authentication to Next.js applications (login, logout, protected pages, middleware, server components) - supports App Router and Pages Router with @auth0/nextjs-auth0 SDK.
969auth0-react-native
Use when adding authentication to React Native or Expo mobile apps (iOS/Android) with biometric support - integrates react-native-auth0 SDK with native deep linking
517auth0-express
Use when adding authentication (login, logout, protected routes) to Express.js web applications - integrates express-openid-connect for session-based auth.
416auth0-mfa
Use when adding MFA, 2FA, TOTP, SMS codes, push notifications, passkeys, or when requiring step-up verification for sensitive operations or meeting compliance requirements (HIPAA, PCI-DSS) - covers adaptive and risk-based authentication with Auth0.
400auth0-angular
Use when adding authentication to Angular applications with route guards and HTTP interceptors - integrates @auth0/auth0-angular SDK for SPAs
346