Independent developer field guide
Edition 0012026
Authentication · Build

Auth.js

Open source, runtime-agnostic library for authentication and session management in JavaScript and TypeScript frameworks.

open source active

What it is

Auth.js is an open-source authentication library built on standard Web APIs for JavaScript runtimes, as maintained in the Auth.js repository. According to the repository, it works with any OAuth 2.0 or OpenID Connect service and supports email and passwordless sign-in and passkeys (WebAuthn). It is runtime agnostic and integrates with several JavaScript frameworks, as the Auth.js getting started guide describes.

When it fits

Auth.js suits developers who want to run their own authentication code and decide how user data is stored. It can run without a database for stateless authentication, or use database adapters to store user data, as the Auth.js repository and the Auth.js getting started guide describe.

What to watch

Project notices in the Auth.js repository say that Auth.js is now part of Better Auth. The maintainers recommend that new projects start with Better Auth, unless a specific feature gap applies, most notably stateless session management without a database.

Who it is for
  • Developers who want to own and host their authentication stack.
  • Teams building with JavaScript frameworks that prefer open source tools and want to avoid vendor lock-in.
Strengths
  • Auth.js is an open source library published under the ISC license that runs on standard Web APIs.Source: github.com · checked Nov 2026
  • The library supports stateless authentication without a database, or it can use external database adapters.Source: github.com · checked Nov 2026
Tradeoffs and limits
  • Auth.js is now part of Better Auth, and the maintainers recommend new projects start with Better Auth unless there are specific feature gaps, most notably stateless session management without a database.Source: github.com · checked Nov 2026
  • User data can be stored in a database through adapters, but that is optional.Source: authjs.dev · checked Nov 2026
Works with
Next.jsSvelteKitExpressQwik
Alternatives