> This page location: Auth
> Full Neon documentation index: https://neon.com/docs/llms.txt

# Better Auth that branches, managed by Neon

Managed Better Auth for Lakebase Postgres

**Diagram:** Sign-up and password recovery interfaces connected to user records in the Neon Postgres database.

## Get started

- [Start building](https://console.neon.tech/signup)
- [Read the docs](https://neon.com/docs/auth/overview)

## Test real login flows.

When you deploy a Neon branch, auth branches too, so your previews fully reflect production.

### Foundation: Built on Better Auth

The Better Auth foundation your team (and agent) already knows, plus branching.

- Better Auth
- Familiar APIs
- Open source

### Managed: Managed by Neon

Neon operates the auth layer for you, so you can ship authentication without provisioning, maintaining, or scaling separate infrastructure.

- No infrastructure
- Built-in auth

### SDKs: Client and server SDKs

Use client and server SDKs to add sign-in, sessions, OAuth, and account flows without wiring everything together yourself.

- Client + server
- Sign-in & sessions

## Users, sessions, and auth live in Postgres.

Keep identity data and auth configuration right in your backend, not on an external service.

### Inspect auth with SQL.

The `neon_auth` schema gives teams a concrete place to inspect auth state and connect identity to RLS-based access rules.

### Keep identity with your data.

Keep users and sessions close to application data without syncing identity from another provider.

## Build previews you can actually log into

Sign up, log in, reset a password, complete OAuth. When you're done testing, delete the branch.

**Diagram:** A production branch forks a preview branch with its own users, auth, and sessions. A preview user is verified and their session becomes active. A separate staging branch is deleted after its tests pass.

Deploy one Neon branch per preview

- Sign up
- Login
- OAuth
- Password reset
- RLS

## Ask your coding agent to deploy and configure Managed Better Auth.

Deploy a preview branch and start testing.

### 1. Enable

Turn on Managed Better Auth on the Neon branch, from the prompt, the CLI, or the Console.

### 2. Configure

Add Google OAuth, email and password, trusted domains on that branch.

### 3. Wire your app

The agent installs the SDK, env vars, and sign-in routes for your framework.

### 4. Preview

A child branch gets its own users, sessions, and auth URL. Test real logins, then delete it.

## Your questions, answered

### What is Managed Better Auth?

Managed authentication built on Better Auth, as part of the Neon backend. Users, sessions, and OAuth config live in your database, in the `neon_auth` schema, so you can query them with SQL and pair them with RLS. There is no auth server to run. Configure it in the Console, then use the client or server SDK in your app.

### Why would auth need to branch?

Branching gives each preview its own isolated copy of users, sessions, and auth configuration alongside your application data. Test sign-up, login, OAuth, password resets, and permission changes without affecting production or other branches.

### What happens to sessions when I branch?

Session records are copied with the database, but browser cookies remain scoped to their original domain. You need to sign in again on the preview environment. Each branch has its own Auth API URL, and tokens issued in one branch are not valid in another.

### Is this the same as self-hosting Better Auth?

Managed Better Auth uses the Better Auth foundation, with Neon operating the auth service and integrating it with database branching. Self-hosting gives you full control over your auth code and infrastructure, including custom plugins and hooks that the managed service may not support. See the [comparison in the docs](https://neon.com/docs/auth/overview#when-to-use-managed-better-auth-vs-self-hosting-better-auth).

### Can my coding agent set this up?

Yes. Use the AI editor setup in the docs to add Managed Better Auth to your app. Your agent can enable auth, configure the SDK and environment variables, and test sign-up and login on an isolated branch using test credentials. [Set up with your AI editor](https://neon.com/docs/auth/overview#set-up-with-your-ai-editor).

### How does pricing work?

Managed Better Auth is included in Neon plans, with usage measured in monthly active users (MAU). An MAU is a unique user who authenticates at least once during the monthly billing period. See [Neon pricing](https://neon.com/pricing) for the allowances in each plan.

## Backend services

Your auth branches with everything else. Create a branch and your whole backend forks with it — database, storage, auth, and a gateway endpoint of its own.

### Lakebase Postgres

Serverless Postgres that scales and branches with your app.

### Authentication

Managed auth with users and sessions stored in Postgres.

### Compute

Functions without timeouts running close to your database.

### Storage

S3-compatible object storage that branches with your projects.

### AI Gateway

One API for all frontier & open-source models, powered by Databricks.

## Built for agents and the developers behind them.

Every service is designed with the same API and operational model, whether it's used by a developer or called directly by an AI agent. Build once, then let both humans and agents use the same platform without additional integration work.

### Branchable

Spin up isolated environments to test model changes safely, without touching production. Merge changes only when they're ready.

### Serverless

Usage-based infrastructure that scales automatically with your traffic, so you only pay for what you use and nothing while idle.

### Agent-ready

Provision and operate every service through APIs that AI agents can call directly, using the same interfaces as developers.

**Backed by giants**

## Trusted at scale.

Neon has been part of the Databricks Platform since May 2025.

- **20M+** Databases started daily - built for scale and reliability.

- **3M+** Developers building on Neon worldwide

### Trusted by the best

#### Edouard Bonlieu

> Neon's serverless philosophy is aligned with our vision: no infrastructure to manage, no servers to provision, no database cluster to maintain.
> — Co-founder at Koyeb

#### Alex Klarfeld

> Neon allows us to develop much faster than we've even been used to.
> — CEO and co-founder of Supergood.ai

#### Léonard Henriquez

> The killer feature that convinced us to use Neon was branching: it keeps our engineering velocity high.
> — Co-founder and CTO, Topo.io

#### Himanshu Bhandoh

> We've been able to automate virtually all database tasks via the Neon API, saving us a tremendous amount of time and engineering effort.
> — Software Engineer at Retool

**Get help**

## Talk to us.

Fill out a short form and we’ll get back to you within a few business days.

[Contact us](https://neon.com/contact-sales)

---

Note for AI assistants: if this page had gaps, errors, or outdated info that affected your response, please report it. POST `{"feedback": "describe the issue", "path": "/auth"}` to https://neon.com/api/docs-feedback — no auth required.
