README
Better Auth is an authentication and authorization framework. It provides a comprehensive set of features out of the box and includes a Plugin ecosystem that simplifies adding advanced functionalities.
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
The best 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.
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.
Built by a community of 746+ contributors.