Better Auth
Framework-agnostic, universal authentication and authorization framework for TypeScript.
Why consider Better Auth?
Better Auth provides a universal, framework-agnostic authentication and authorization solution for modern TypeScript applications. It offers built-in session management, social login, and extensible plugins without mandatory third-party hosted dependencies.
Learn Better Auth by building
Practical setup notes, real use cases, and copy-ready examples in one focused guide.
In this guide3 sections
Overview of Better Auth
Better Auth is a framework-agnostic, universal authentication and authorization framework for TypeScript that provides built-in capabilities and an extensible plugin ecosystem. Designed to run self-hosted or inside existing application servers, the library gives developers complete architectural control over authentication logic, user accounts, and session lifecycles without third-party vendor lock-in.
The framework includes built-in features for email and password authentication, account and session management, rate limiting, and social sign-on.
Engineers can build authentication that lives inside their application with composable, plugin-based architecture for consumer and enterprise apps.
Installation and Core Configuration
npm install better-authimport { betterAuth } from "better-auth";export const auth = betterAuth({ //...});Configuration relies on a high-entropy secret key of at least 32 characters assigned to the BETTER_AUTH_SECRET environment variable.
Enterprise Capabilities
Better Auth version 1.7.1 added native database transaction support to test instances for PostgreSQL and MySQL databases.
The project is licensed under the permissive MIT License.
Related tools
More options with a similar category or technology profile.
diskus
Minimal, fast alternative to du -sh written in Rust using multi-threaded directory traversal.
peco
Simplistic interactive filtering tool for Unix pipelines, process lists, and file trees.
Dapr CLI
Command-line tool for managing Dapr distributed application runtime environments and sidecars.
Freeze
Generate beautiful image screenshots and SVGs of code snippets and terminal outputs.