README

Auth that lives inside your app. Composable, plugin-based, and built to scale — powering from weekend projects to the biggest consumer and enterprise apps on the planet.

npx auth init

Trusted by

OpenAIdatabricksVercelstrapibeatBreadArtlist

Features

01

Works with your stack.

Next.js, Nuxt, SvelteKit, Astro, Hono, and 20+ more.

nextnuxtsvelteastrohono+14
02

Built-in credential auth.

Sessions, email verification, and password reset included.

user@email••••••••
03

Social sign-on.

Google, GitHub, Apple, Discord, and more.

googlegithubapplediscord+8
04

Multi-tenancy built in.

Teams, roles, invitations, and access control.

owneradminmember
05

Enterprise ready.

SSO, SAML 2.0, SCIM, and directory sync.

ssosamlscimsync
06

50+ and growing.

Passkeys, magic links, API keys, JWTs, and more.

passkeys2famagic-link
07

Auth for AI agents.

MCP auth, token-exchange, and agent delegation.

$ agent.auth() → ok ✓
08

Security & observability.

Bot detection, IP blocking, and email validation.

blockedchallenged
09

User management.

Manage users, sessions, and organizations.

ended a session · 10:48 AM

Framework

The most comprehensive authentication framework for TypeScript.

auth.ts
1import { betterAuth } from "better-auth"
2 
3export const auth = betterAuth({
4 emailAndPassword: {
5 enabled: true,
6 },
7 socialProviders: {
8 google: {
9 clientId: process.env.GOOGLE_CLIENT_ID!,
10 clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
11 },
12 github: {
13 clientId: process.env.GITHUB_CLIENT_ID!,
14 clientSecret: process.env.GITHUB_CLIENT_SECRET!,
15 },
16 },
17 plugins: [twoFactor(), passkey()], // 50+ more
18})

No dashboard clicks. Your auth lives in code — version controlled, type-safe, and reviewable in PRs.

dash.better-auth.com

Active Users

1,284

New Users

312

Sessions

5,907

Dashboard

  • +User management
  • +Session monitoring
  • +Organization oversight
  • +User analytics

Audit Logs

  • +Auto-captured events
  • +Filter & search
  • +Configurable retention
  • +Log drain to SIEM

Enterprise

  • +Self-service SSO
  • +SCIM provisioning
  • +Directory sync
  • +RBAC

Sentinel

Real-time threat detection before it reaches your users.

Impossible TravelRate LimitingGeo BlockingSuspicious IPsDisposable EmailsEmail AbuseFree Trial Abuse

Explore plans

Dashboard, audit logs, security detection, transactional comms, and more.

View Plans

Contributors

Built by a community of 876+ contributors.

Roll your own auth with confidence in minutes.

4.3M / week29k stars