Better Auth

The most comprehensive, framework-agnostic authentication and authorization framework for TypeScript.

Framework
npm
v1.7.1
29,583stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
89/100Excellent
Development Activity100
Maintenance100
Community68
Maturity48
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
84/100Excellent
Architecture90
Code Quality88
Innovation88
Learning Curve70

Better Auth is a framework-agnostic authentication and authorization framework for TypeScript that ships a complete feature set out of the box instead of leaving you to assemble one from scratch. It handles email/password, social and OAuth2 sign-in, sessions, and account management with type-safe server and client APIs.

A first-class plugin ecosystem extends the core with advanced capabilities such as two-factor authentication, passkeys, organizations and multi-tenancy, magic links, SSO, an OIDC provider, and more, so you can add sophisticated auth flows with minimal code while keeping full control over your database and application stack.

What You Get

  • A type-safe betterAuth() server instance with email/password, session, and OAuth2 social sign-in built in
  • A matching type-safe client (createAuthClient) with framework bindings for React, Vue, Svelte, Solid, and vanilla JS
  • A rich plugin system covering 2FA, passkeys, organizations, magic links, SSO, OIDC provider, admin, and more
  • Database adapters for Drizzle, Prisma, Kysely, MongoDB, and in-memory storage, plus a schema/migration generator
  • Framework integrations for Next.js, SvelteKit, SolidStart, TanStack Start, Node, and Expo

Common Use Cases

  • Adding email/password and social login to a Next.js, SvelteKit, or Solid application
  • Standing up multi-tenant SaaS auth with organizations, roles, and invitations
  • Enforcing strong security with two-factor authentication, passkeys, and rate limiting
  • Running your own OIDC/OAuth provider or SSO for internal services

Under The Hood

Architecture - The published better-auth package is the aggregation layer of a pnpm/turbo monorepo: packages/better-auth/src/index.ts re-exports a @better-auth/core runtime and pulls in workspace adapters (Drizzle, Prisma, Kysely, Mongo, memory) and telemetry. The betterAuth() factory in src/auth/full.ts builds a context (src/context/init.ts) that wires the configured database adapter, session and cookie handling (src/cookies, src/db), the OAuth2 flow engine (src/oauth2), and an endpoint dispatcher (src/api) that converts plugin-declared routes into a single mountable request handler. Roughly thirty first-party plugins under src/plugins (2FA, passkey, organization, magic-link, OIDC provider, admin, SSO) hook into that context, and matching client plugins under src/client produce a type-inferred createAuthClient with bindings for React, Vue, Svelte, Solid, and vanilla JS.

Tech Stack - Written almost entirely in TypeScript (~99.98%) and built with tsdown/turbo. Core runtime dependencies are deliberately lean: zod v4 for schema validation, jose for JWT/JWKS, @noble/hashes and @noble/ciphers for cryptography, better-call for typed endpoints, @better-fetch/fetch for the client transport, nanostores for client session state, and kysely/defu utilities. Database drivers and host frameworks (Next.js, SvelteKit, Solid, TanStack Start, Prisma, Drizzle, pg, mysql2, mongodb, react, vue, svelte) are all peer dependencies, keeping the core framework-agnostic and unopinionated about the surrounding stack.

Code Quality - The codebase is thoroughly tested, with roughly 97 *.test.ts files colocated alongside source in the main package (plus dedicated test/ and e2e/ suites at the repo root running under Vitest). Code is organized by concern into small, single-responsibility modules, formatted and linted with Biome, spell-checked with cspell, dependency-pruned with knip, and gated by lefthook git hooks. Changesets drives versioning and the project ships an AGENTS.md contributor guide, indicating a mature, disciplined engineering process.

API Design - The developer experience is a core selling point: a single betterAuth({...}) call configures the server and the client type is inferred from it, so enabling a plugin or extra field automatically surfaces on the typed client with no manual duplication. Plugins are added declaratively to an array, framework integration is a one-line handler mount, and a schema/migration generator scaffolds the required tables. The main tradeoff is breadth over minimalism — the large surface of plugins, adapters, and configuration options means a moderate learning curve to discover the right pieces, but everyday flows require little boilerplate.

Used by 35 apps in this directory

TypeScript
49%
AGPL 3.0

BrowserOS

Browser · AI Assistants

13,248

The open-source agentic Chromium browser with native AI agents, MCP server, and visual workflow automation — your data never leaves your machine.

View details
87
Repo Health
82
Technical
69
Dependency
Built with
TypeScript49%
Rust22%
Python16%
Updated today
JavaScript
50%
Apache 2.0

claude-mem

AI Agents · AI Development

91,197

Give your AI coding agents persistent memory — claude-mem captures everything that happens during sessions, compresses it with AI, and surfaces the right context in every future session automatically.

View details
86
Repo Health
82
Technical
77
Dependency
Built with
JavaScript50%
TypeScript48%
Updated today
TypeScript
93%
AGPL 3.0

CourseLit

Ecommerce · Blogging

1,255

Open-source, self-hosted LMS for selling online courses, digital downloads, and building communities on your own branded website.

View details
78
Repo Health
74
Technical
72
Dependency
Built with
TypeScript93%
Updated 4 weeks ago
TypeScript
99%
Other

Dokploy

Devops · Hosting Control Panel · Security

36,702

Self-hosted PaaS that deploys apps and databases on your own VPS using Docker, Traefik, and multi-build-system orchestration

View details
89
Repo Health
76
Technical
65
Dependency
Built with
TypeScript99%
Updated yesterday
TypeScript
72%
Other

Epicenter

Knowledge Management · Note Taking · Developer Tools

4,761

A local-first monorepo led by Whispering, an open-source speech-to-text app, built on an MIT toolkit that turns your data into plain Markdown and SQLite files you own instead of a database you rent.

View details
88
Repo Health
90
Technical
68
Dependency
Built with
TypeScript72%
Svelte15%
Updated today
TypeScript
98%
Other

Formbricks

Forms Surveys · Marketing · Analytics

12,790

Open-source experience management platform for in-app, website, email, and link surveys — privacy-first and fully self-hostable.

View details
93
Repo Health
81
Technical
73
Dependency
Built with
TypeScript98%
Updated today
TypeScript
91%
Apache 2.0

Helicone

Monitoring · AI Development · Analytics

6,083

An open-source AI gateway and LLM observability platform that routes requests to 100+ models while logging cost, latency, and full traces for every call.

View details
62
Repo Health
81
Technical
66
Dependency
Built with
TypeScript91%
Updated 3 days ago
TypeScript
98%
AGPL 3.0

Kan

Project Management

5,357

An open-source, self-hostable Kanban board built as a modern Trello alternative with team workspaces, board permissions, and Trello import.

View details
85
Repo Health
78
Technical
67
Dependency
Built with
TypeScript98%
Updated 1 weeks ago
TypeScript
94%
MIT

Kaneo

Product Management · Productivity · Project Management

8,371

Lightweight self-hosted project management that gives you kanban boards, GitHub sync, and full team collaboration without the enterprise bloat.

View details
86
Repo Health
81
Technical
70
Dependency
Built with
TypeScript94%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search