What problem does it solve?
Developers need to add secure authentication and authorization across frameworks without tying to a single stack, while supporting modern features like OAuth, 2FA, RBAC, and session management.
Core Features & Use Cases
- Framework-agnostic authentication/authorization for TypeScript apps with support for email/password, social OAuth, RBAC, and multi-tenant setups.
- Plugins and adapters enable seamless integration with Next.js, Nuxt, SvelteKit, Express, and other frameworks, plus database backends like Drizzle, Prisma, Kysely, and MongoDB.
- Use Case: Rapidly add secure login flows to a SaaS product with multiple teams and roles, while keeping codebase framework-agnostic.
Quick Start
Install the better-auth package, configure your database adapter and environment variables, generate the auth config via the CLI, and mount the API handler in your framework. Then run migrations and start your dev server. For example, install, run the interactive initializer, set BETTER_AUTH_SECRET and BETTER_AUTH_URL, and integrate the generated auth.ts into your app.