--- title: Neon Auth subtitle: Managed authentication that branches with your database enableTableOfContents: true updatedOn: '2025-12-11T10:46:56.810Z' redirectFrom: - /docs/neon-auth/quick-start/nextjs --- Neon Auth is a managed authentication service that stores users, sessions, and auth configuration directly in your Neon database. When you branch your database, your entire auth state branches with it. This lets you test test real authentication workflows in preview environments. ## Why Neon Auth? - **Identity lives in your database** All authentication data is stored in the `neon_auth` schema. It's queryable with SQL and compatible with Row Level Security (RLS) policies. - **Zero server management** Neon Auth runs as a managed REST API service. Configure settings in the Console; use the [SDK](/docs/reference/javascript-sdk) in your app. No infrastructure to maintain. - **Auth that branches with your data** Test sign-up, login, password reset, and OAuth flows in isolated branches without touching production data. ## Built on Better Auth Neon Auth is powered by Better Auth, which means you get familiar APIs. You can use Better Auth UI components or call auth methods directly to build your own UI. ## Basic usage Enable Auth in your Neon project, then add authentication to your app: ```typescript import { createAuthClient } from '@neondatabase/neon-js/auth'; export const authClient = createAuthClient(import.meta.env.VITE_NEON_AUTH_URL); ``` ```tsx import { NeonAuthUIProvider, AuthView } from '@neondatabase/neon-js/auth/react/ui'; import { authClient } from './auth'; export default function App() { return ( ); } ``` ## Use cases - **Production authentication** Use Neon Auth as the identity system for your app. Store users, sessions, and OAuth configuration directly in Postgres, and pair with RLS for secure, database-centric access control. - **Preview environments** Test full authentication flows in Vercel previews with real users and sessions - **Multi-tenant SaaS** Test complex org and role hierarchies safely in isolated branches - **CI/CD workflows** Run end-to-end auth tests without touching production - **Development workflows** Spin up complete environments instantly with database and auth together See [Branching authentication](/docs/auth/branching-authentication) for details on how auth branches with your database. ## Quick start guides Choose your framework to get started: ## Availability Neon Auth is currently available for AWS regions only. Azure support is not yet available. ## Migration from Stack Auth If you're using the previous Neon Auth implementation via Stack Auth, your version will continue to work. When you're ready to migrate to the new Better Auth implementation, see our [migration guide](/docs/auth/migrate/from-stack-auth).