What problem does it solve?
Modern web apps struggle to implement consistent authentication, session management, and multi-provider support in a type-safe, maintainable way. Better Auth provides an extensible schema and a plugin system to unify authentication concerns across frontend and backend.
Core Features & Use Cases
- Extensible session schema: easily add custom fields (e.g., activeTenantId, activeWorkspaceId, role) to tailor sessions to your domain.
- Plugin ecosystem: integrate twoFactor, passkey (WebAuthn), and optional features like organization for multi-tenant setups.
- End-to-end guidance: server and client configuration examples, Hono handler integration, and automatic schema generation to keep type safety in sync.
- Security-first defaults: CSRF protection guidance, secure cookies in production, and trusted origins configuration.
- Use Case: SaaS apps with role-based access, tenant contexts, and secure social login flows.
Quick Start
Install better-auth, set BETTER_AUTH_SECRET and BETTER_AUTH_URL, and integrate the server and client setup to begin authenticating users.