icon of Better Auth

Better Auth

Better Auth is an open source TypeScript authentication framework with MFA, social sign-on, multi-tenancy, and session management for any TypeScript backend. A self-hosted alternative to Clerk and Auth0. MIT licensed.

27.9K stars2.5K forksTypeScriptMITActive this week
Open source alternative toAuth0OktaFirebase Authentication

What Better Auth does

Better Auth is an open source TypeScript authentication framework that provides MFA, social sign-on, multi-tenancy, and session management as a library you run in your own application, without routing authentication through a managed identity provider.

The Problem

Authentication services like Clerk, Auth0, and WorkOS simplify implementation but create a critical dependency: every authentication event for every user passes through the provider's servers. Pricing scales with monthly active users, making identity increasingly expensive as applications grow. Teams building regulated applications or multi-tenant SaaS face a particular tension: they need complete auth features but cannot accept vendor lock-in or data residency concerns from a managed identity cloud.

How Better Auth Solves It

Better Auth is a TypeScript library that runs inside your own application. It handles password hashing, session management, OAuth flows, and MFA without any external service. Configure providers, plugins, and adapters in TypeScript code; Better Auth integrates with any backend framework (Next.js, Express, Hono, Remix). Email/password, OAuth, and passkey flows are all built-in. MIT license applies.

Key Features
  • Framework-agnostic: works with Next.js, Express, Hono, Remix, and other TypeScript backends
  • Built-in social sign-on via OAuth (Google, GitHub, and more) without a managed auth cloud
  • MFA with TOTP, SMS, and backup code support out of the box
  • Multi-tenancy with organizations, team invites, and role-based access control
  • Passkey and WebAuthn support for passwordless authentication
Who It's For

Better Auth is best for TypeScript developers building web applications who need a full-featured authentication library they can run self-hosted, without paying per-MAU pricing or routing authentication events through a managed identity provider.

Compared to Clerk

Unlike Clerk, which charges per monthly active user and processes all authentication on Clerk's managed cloud, Better Auth is MIT licensed and runs inside your own application. Clerk offers a polished hosted UI with no backend setup; Better Auth gives you full authentication code ownership with no MAU-based pricing.

GitHub Activity

27.9KStars
2.5KForks
695Open Issues
MITLicense

Tech Stack

language TypeScript

Details

Frequently Asked Questions

Related Alternatives

Stay Updated

Subscribe to our newsletter for the latest news and updates about Alternatives