mrkeyoor.com_
Tue 01 Sept 17:42 UTC
Webevaluationupdated 26 Aug 2026

better-auth review

Better Auth is a TypeScript authentication and authorization library that keeps user data in your own database. It handles email and social sign-in, sessions, framework routes, and optional features such as passkeys, two-factor authentication, organizations, SSO, and MCP authorization through plugins.

+90stars / 7d
Verdict

Our Better Auth install occupied 2,841 MB and the test command ended with a failure after 159 seconds, so its convenient application API sits on top of a large, fast-moving codebase. Use it when keeping auth data in your database and composing TypeScript plugins matter more than outsourcing identity operations. Pin releases and test the exact adapter, framework, and plugins you deploy.

We ran it

Lab card: what happened when we ran better-authScreenshot of better-auth (better-auth.com)
Install✓ · 59s2442 packages · 2841 MB
Build✓ · 113s
Tests✗ · 159s334 passed · 1 failed of 335 (vitest)
Repo2201 files~465,466 lines of source · 47 MB · 16 CI workflows · tests dir

Answers from our run

Does better-auth build from source?

Dependencies installed in 59 seconds (2442 packages), and the build succeeded in 113 seconds. We cloned commit 79904f0 into a clean Debian container with 3 CPUs and no project-specific setup.

Do better-auth's tests pass?

Not all of them: 334 of 335 passed and 1 failed when we ran the project's own test command (vitest). Some failures need services or credentials a bare container does not have.

Who should not use better-auth?

CommonJS applications: the installation guide says CommonJS is unsupported.

What are the alternatives to better-auth?

Auth.js, Lucia, Keycloak. Our Better Auth install occupied 2,841 MB and the test command ended with a failure after 159 seconds, so its convenient application API sits on top of a large, fast-moving codebase.

Setup3/5Simple app API, but 2,442-package source install and migrations
Docs5/5Detailed setup, framework, database, plugin, and security guides
Community5/529,688 stars with same-day pushes and active reports
Maturity4/5Broad v1.7 feature set, with current adapter and plugin defects

Discussed on

  1. hnFrom Supabase to Clerk to Better Auth304 points
  2. hnAuth.js is now part of Better Auth179 points
  3. hnBetter Auth is joining Vercel128 points
  4. hnBetter Auth – Authentication library for TypeScript73 points
  5. hnShow HN: Comprehensive authentication library for TypeScript72 points

Who it’s for

TypeScript teams that want auth inside their application and data inside their database.
Products that need more than social login, including organizations, passkeys, SSO, or multi-session support.
Developers using standard Request and Response servers across Next.js, Hono, Nuxt, SvelteKit, or other supported frameworks.
Teams willing to own database migrations, mail delivery, provider credentials, and auth upgrades.

Who it’s NOT for

CommonJS applications: the installation guide says CommonJS is unsupported.
Teams that want authentication operations transferred to a managed vendor: Better Auth leaves the database, email, provider setup, monitoring, and incident response with the adopter.
Projects that need most plugins without a database: stateless sessions are documented, but the installation guide says most plugins require a database.
Cloudflare Worker deployments using generic OIDC without a local risk test: issue #10999 reports discovery during each auth-instance initialization, with no exposed timeout or cache.
Teams requiring a clean monorepo test run before adoption: our sandbox summary recorded 334 passing tests and 1 failure out of 335.

Setup reality

Our sandbox installed 2,442 packages in 59 seconds, consuming 2,841 MB on disk, and the build succeeded in 113 seconds. Tests failed after 159 seconds: the harness summary recorded 334 passed and 1 failed out of 335. The log tail separately shows the main package with 2 failed test files, 96 passed, and 1 skipped, plus 2,600 passing tests, 2 failures, 11 skips, and 1 todo.

A basic app needs a secret of at least 32 characters, a base URL, an auth instance, a database or stateless session choice, schema generation or migration, a server route, and a client. Social providers add client IDs and secrets; email flows need delivery; plugins can add tables and configuration.

Our test method used commit 79904f0 in an unprivileged Node 22 container with 3 CPUs, 8 GB of RAM, and no secrets. This is a 2,201-file pnpm monorepo with 16 CI workflows and a Compose file but no Dockerfile, so source work is much heavier than adding the published package to one app.

Better Auth keeps identity code and data inside the application

Better Auth gives a TypeScript application a server handler, typed client, session model, and database schema rather than sending every identity operation to a hosted vendor. Email and password login and social providers cover the basic path. Plugins add passkeys, magic links, two-factor authentication, organizations, SSO, SCIM, API keys, and an OAuth provider. The same library can sit beside an application or run as a separate self-hosted auth server. User records remain in the database the team already controls.

The project had 29,688 GitHub stars and 680 open issues and pull requests when we fetched it on August 26, 2026. That interest makes the adapter and plugin ecosystem attractive, yet the combined open count also signals a lot of moving surface area. Better Auth is framework agnostic because its handler uses standard Request and Response objects. Its guides provide specific wiring for Next.js, Nuxt, SvelteKit, Hono, Cloudflare Workers, Express, Expo, and several other runtimes. CommonJS is expressly unsupported.

The quick start still includes a database and schema work

Installation starts with the package, a high-entropy secret of at least 32 characters, and a base URL. The app creates an auth instance, chooses a database, generates or migrates the required tables, mounts a catch-all route, and creates a client instance. SQLite, PostgreSQL, and MySQL can connect directly. Drizzle, Prisma, MongoDB, and other adapters cover projects that already have a persistence layer. Stateless sessions are possible, although the guide says most plugins need a database.

A social login adds at least 2 provider values, the client ID and client secret, plus callback configuration at the provider. Password reset, verification, and magic-link features need an email sender. Passkeys, organizations, SSO, SCIM, and API keys add their own policy decisions and sometimes schema. Better Auth avoids per-user vendor pricing, but it does not remove operational ownership. The adopting team is responsible for secret rotation, migrations, mail reliability, abuse controls, backups, logs, and security response.

What happened when we ran it

Our sandbox installed 2,442 packages in 59 seconds and used 2,841 MB on disk. The build then succeeded in 113 seconds. We tested commit 79904f0 inside an unprivileged lab-node:22 container with 3 CPUs, 8 GB of RAM, and no secrets. The checkout held 2,201 files and about 465,466 source lines. These numbers describe the pnpm monorepo development path, not the cost of adding one runtime package to an application.

The test command failed after 159 seconds. Our harness summary recorded 334 passing tests and 1 failing test out of 335. The supplied log tail shows another layer of workspace reporting: better-auth:test ended with 2 failed files, 96 passed files, 1 skipped file, 2,600 passing tests, 2 failures, 11 skips, and 1 todo. It also shows all 924 OAuth-provider tests passing. We cannot reconcile the two aggregation levels from the tail alone, so both are reported without inventing a cause.

Plugins save code while increasing the upgrade surface

Better Auth's plugin design is more substantial than a list of callbacks. A plugin can define endpoints, database tables, hooks, request middleware, rate limits, trusted origins, and a typed client extension. That makes it possible to add an organization or passkey feature without forking the core. The CLI includes plugin schema in generated migrations, and additional user or session fields flow into inferred TypeScript types. Teams can also write private plugins for their own policies.

Version v1.7.1, released August 18, 2026, shows both the value and the cost of that breadth. It fixed database transactions, SCIM parsing and credentials, SAML assertion verification, adapter transactions, OAuth scope errors for MCP clients, and a dangerous CLI migration case. Current issue #10913 reports that the same OAuth-provider release rejects every loopback redirect URI for web clients. Issue #10947 reports nullable Drizzle v1 fields where generated schema should include notNull(). Each deployed combination needs regression tests.

Edge runtimes need more scrutiny than Node servers

Cloudflare Workers are documented, including the Node compatibility flag needed for AsyncLocalStorage. The docs also support constructing auth from request-scoped bindings, which is common on that platform. Issue #10999 identifies a specific concern in v1.7.1: generic OAuth discovery reportedly runs during plugin initialization for every auth instance, has no shared cache, and exposes no fetch timeout. A stalled identity provider could therefore affect routes that only need an existing session. The report is source analysis, not a documented production outage.

That distinction matters because authentication failures have a wide blast radius. A team deploying to Workers should reproduce the generic OIDC path under slow and unavailable discovery endpoints before launch. Node applications should test migration rollback, session revocation, provider token refresh, and email failure. The repository includes 16 CI workflow files and a tests directory, but our red run is reason enough to treat local integration coverage as part of the product, not optional ceremony.

Current development is healthy and demands careful pinning

GitHub recorded a push on August 26, 2026, eight days after v1.7.1. New issues received replies within hours, and the release notes span core, adapters, SCIM, SSO, OAuth, and CLI packages. That is healthy maintenance for a security-sensitive library. It also means a minor release can touch several authentication protocols and storage paths at once. The 680 open issues and pull requests should be read as an active queue, not a defect count.

Better Auth is strongest for a TypeScript team that wants ownership and has the discipline to exercise it. Choose a small set of plugins, keep schema changes in normal review, and pin every Better Auth package to compatible versions. Test login, logout, revocation, provider failure, and migration against a copy of production data. If the team wants someone else to handle those duties, a managed identity service is the honest alternative. If it wants control, Better Auth is one of the most capable open choices, with a heavier source tree than its tidy API suggests.

Alternatives

ProjectWhat it isPick it when
Auth.jsA widely used web authentication library with deep framework integrations.pick this instead when an Auth.js-supported framework and its established adapter ecosystem match your application.
LuciaA learning resource and low-level reference for implementing sessions yourself.pick this instead when you want to understand and write the auth layer rather than adopt a feature-rich library.
Keycloak gh↗A standalone identity server with administration, federation, and enterprise protocols.pick this instead when identity should be a separate service managed across many applications.

What people are saying

  1. [velocity-scout] better-auth/better-auth

Sources

  1. Better Auth repository and README
  2. Better Auth installation guide
  3. Better Auth v1.7.1 release notes
  4. Generic OAuth discovery initialization report
  5. Drizzle v1 schema generation report

More web reviews

axios · super-productivity · Graphite · fastify · tabler · go-zero · the whole board →