Skip to main content
Better Auth is a framework-agnostic, universal authentication and authorization framework for TypeScript. It provides a comprehensive set of features out of the box and includes a plugin ecosystem that simplifies adding advanced functionality. Whether you need 2FA, passkeys, multi-tenancy, multi-session support, or enterprise features like SSO and OIDC, Better Auth lets you focus on building your application instead of reinventing auth.

Features

Better Auth aims to be the most comprehensive auth library for TypeScript. Here are some of the capabilities available out of the box:

Email & password

Built-in email and password authentication with configurable password policies, auto sign-in after registration, and email verification.

Social OAuth

30+ social providers including Google, GitHub, Apple, and Discord. Fully configurable with clientId, clientSecret, and callback URLs.

Two-factor authentication

TOTP-based 2FA with QR code setup, backup codes, and trusted device support via the twoFactor plugin.

Passkeys

WebAuthn-based passwordless authentication using device biometrics or hardware security keys.

Organizations & multi-tenancy

Team management with roles, permissions, invitations, and SCIM provisioning via the organization plugin.

OIDC & SSO

Act as an OpenID Connect provider or connect to enterprise identity providers using SAML SSO.

Plugin system

Extend Better Auth with magic links, username auth, phone number, anonymous sessions, API keys, and more.

Database adapters

Native adapters for Drizzle, Prisma, and MongoDB. Direct support for SQLite, PostgreSQL, and MySQL.

Type-safe by default

Full TypeScript inference across your server and client — no type casting or manual type definitions needed.

Framework agnostic

Works with Next.js, Nuxt, SvelteKit, Hono, Express, Expo, and any runtime that supports standard Request/Response objects.
…and much more!

AI tooling

Better Auth provides first-class support for AI-assisted development.

LLMs.txt

Better Auth exposes an llms.txt file that helps AI models understand how to integrate with and configure your authentication system. You can find it at https://better-auth.com/llms.txt.

MCP server

Better Auth provides an MCP (Model Context Protocol) server so you can use it with any AI model that supports MCP — including Cursor, Claude Code, and OpenCode. Use the auth CLI to add the Better Auth MCP server to your preferred AI coding assistant:
npx auth mcp --claude-code
You can also run npx auth mcp without flags to get an interactive setup prompt that walks you through connecting to your MCP client.

What’s next

Installation

Install Better Auth, set up your database, and mount the route handler in your framework.

Basic usage

Sign users up, sign them in, manage sessions, and use the client SDK.

Plugins overview

Explore the full plugin ecosystem — 2FA, organizations, passkeys, SSO, magic links, and more.

API reference

Browse all configuration options and the full public API surface.