What problem does it solve?
Better Auth removes the complexity of implementing secure, production-ready authentication and authorization in TypeScript and JavaScript applications by providing a unified, extensible framework that handles credentials, social login, and advanced auth features.
Core Features & Use Cases
- Built-in Email/Password and OAuth: Ready-made flows for email/password, GitHub, Google, Discord and many other providers.
- Advanced Security: Optional plugins for two-factor (TOTP), passkeys/WebAuthn, magic links, and session revocation.
- Operational Tools: Database adapters (Prisma, Drizzle, Kysely, MongoDB), schema generation/migrations, rate limiting, RBAC, and multi-organization support.
- Use Case: Integrate into a Next.js or Expo backend to provide user signup/signin, social login, 2FA enrollment, and session management with minimal wiring.
Quick Start
Install Better Auth, add BETTER_AUTH_SECRET and BETTER_AUTH_URL to your environment, create an auth.ts instance with your chosen database adapter, and mount the provided API handler in your framework.