README
Better Auth is an authentication framework. It provides a comprehensive set of features out of the box and includes a Plugin ecosystem that simplifies adding advanced functionalities and infrastructure to help own your auth at scale.
npx auth initimport { betterAuth } from "better-auth"export const auth = betterAuth({ emailAndPassword: { enabled: true, }, socialProviders: { google: { clientId: process.env.GOOGLE_CLIENT_ID!, clientSecret: process.env.GOOGLE_CLIENT_SECRET!, }, github: { clientId: process.env.GITHUB_CLIENT_ID!, clientSecret: process.env.GITHUB_CLIENT_SECRET!, }, }, plugins: [ twoFactor(), passkey(), organization(), ],})Use any database you want. Connect directly with a connection string, or use your favorite ORM adapter. Your data stays in your database.
Your auth lives in your codebase — so AI can configure it. Ships with MCP server, Claude Code skills, and Cursor rules.
Cursor
npx @better-auth/cli mcp --cursorClaude Code
claude mcp add better-authOpen Code
npx @better-auth/cli mcp --open-codesocial providers
Managed infrastructure on top of the open-source framework.
User management and monitoring platform.
Monitor sign-ups, manage users, track sessions, and surface security insights — with an agentic Cmd+K to do it all in natural language.
Audit Logs
Every auth event captured automatically — sign-ins, password resets, MFA challenges, session changes, and more. Filter, search, and export with configurable retention and log drain to your SIEM.
Transactional Comms
Built-in email and SMS delivery for verification codes, magic links, password resets, and MFA. Customizable templates, abuse protection, and delivery tracking — no third-party setup required.
Security infrastructure for your app.
Bot detection, brute force protection, disposable email blocking, geo restrictions, and more — all working in real time before threats reach your users.
Explore plans
Dashboard, audit logs, security detection, transactional comms, and more.
Built by a community of 746+ contributors.