npx skills add ...
npx skills add neondatabase/neon-js --skill neon-auth-react
Sets up Neon Auth in React applications (Vite, CRA). Configures authentication adapters, creates auth client, and sets up UI components. Use when adding auth-only to React apps (no database needed).
npx skills add neondatabase/neon-js --skill neon-auth-react
Help developers set up @neondatabase/auth (authentication only, no database) in React applications with Vite, Create React App, or similar bundlers.
Use this skill when:
neon-auth-nextjs skill for Next.js)() - they are factory functions@neondatabase/auth/react/adapterscreateAuthClient(url, config)/ui/css OR /ui/tailwind, never bothsrc/auth-client.ts)src/providers.tsx)src/main.tsx)Without Tailwind (pre-built CSS bundle ~47KB):
With Tailwind CSS v4:
IMPORTANT: Never import both - causes duplicate styles.
The provider includes next-themes for dark mode. Control via defaultTheme prop:
Override CSS variables in your stylesheet:
Full configuration options:
Handles sign-in, sign-up, forgot password, and callback routes:
Supported pathnames: sign-in, sign-up, forgot-password, reset-password, callback, sign-out
Dropdown menu with user avatar, name, and sign-out:
Native Better Auth API with React hooks:
For migrating from Supabase or familiar API:
For vanilla JS/TS without React hooks:
Enable providers in NeonAuthUIProvider:
google, github, twitter, discord, apple, microsoft, facebook, linkedin, spotify, twitch, gitlab, bitbucket
OAuth automatically uses popup flow when running in iframes (due to X-Frame-Options restrictions). No configuration needed.
Session object shape:
Enable RLS-based data access for unauthenticated users:
Automatic via BroadcastChannel. Sign out in one tab signs out all tabs.
| Error | Cause |
|---|---|
Invalid credentials | Wrong email/password |
User already exists | Email already registered |
Email not verified | Verification required |
Session not found | Expired or invalid session |
Rate limited | Too many requests |
When using allowAnonymous: true, you must grant permissions to the anonymous role in your database:
Your RLS policies must also allow the anonymous role:
OAuth automatically uses popup flow in iframes. Make sure:
Check that:
emailVerification setting)