Better Auth
A plugin-based auth framework for TypeScript that supports 20+ frameworks, social logins, multi-tenancy, and enterprise features like SSO and SCIM. Built for scalability from weekend projects to large-scale apps.

Better Auth
The most comprehensive authentication framework for TypeScript applications. Better Auth is designed to be composable, plugin-based, and built to scale—powering everything from weekend projects to the largest consumer and enterprise apps.
Key Features
- Framework Agnostic: Works seamlessly with Next.js, Nuxt, SvelteKit, Astro, Hono, and 20+ more frameworks.
- Built-in Credential Auth: Includes sessions, email verification, and password reset out of the box.
- Social Sign-On: Supports Google, GitHub, Apple, Discord, and 34+ OAuth providers.
- Multi-Tenancy: Built-in teams, roles, invitations, and access control for organizational apps.
- Enterprise Ready: Features SSO, SAML 2.0, SCIM, and directory sync for large-scale deployments.
- 50+ Auth Methods: Passkeys, magic links, API keys, JWTs, anonymous sessions, OIDC, and more.
- AI Agent Auth: MCP auth, token exchange, and agent delegation for AI-powered applications.
- Security & Observability: Bot detection, IP blocking, email validation, and real-time threat monitoring.
- User Management: Comprehensive dashboard for managing users, sessions, and organizations with audit logs.
- Self-Hosted Infrastructure: Connect to Better Auth's infrastructure for enhanced security, analytics, and enterprise features.
Tech / Self-Hosting
Better Auth is a TypeScript framework that can be self-hosted or used with Better Auth's managed infrastructure. The framework supports declarative configuration, bringing your own database, and integrates with OAuth providers. Enterprise features like SSO, SCIM, and advanced security are available through the managed service.
```typescript import { betterAuth } from "better-auth"
export const auth = betterAuth({ emailAndPassword: { enabled: true }, socialProviders: { google: { clientId: process.env.GOOGLECLIENTID!, clientSecret: process.env.GOOGLECLIENTSECRET! }, github: { clientId: process.env.GITHUBCLIENTID!, clientSecret: process.env.GITHUBCLIENTSECRET! } }, plugins: [twoFactor(), passkey(), organization()] }) ```