# Auth.js: 4.0 out of 10

Keep, but not for new work. 8th of 10 in [Authentication libraries](https://elestia.ai/opensource/auth/index.md).

Auth.js (next-auth) is the long-standing open-source sign-in library for Next.js. Since September 2025 the Better Auth team has run it in security-patch mode, and that team tells new projects to start with Better Auth. v4 is the stable line. v5 has been in beta for about three years. Keep it where it already runs. For new work, pick Better Auth.

**Best for:** Teams with an existing NextAuth/Auth.js app that want to keep it patched, or apps that need stateless JWT sessions with no database.

## Scores

- **Overall: 4.0** (likely 3.0 to 5.1)
  - Claude Opus 5.5 (3.5): It still works and still gets security patches. But it is in maintenance mode, v5 is stuck in beta, and its own maintainers send new projects to Better Auth, which does the same job better for most people. Keep it where it already runs and pick Better Auth for new work. It is worth considering only when stateless sessions with no database are a hard requirement.
  - GPT-6.2 Sol (4.4): Stable v4 is competent for Next.js sign-in and sessions, and the July patches make it reasonable to keep in existing apps. Better Auth now offers database-free sessions, broader framework support, and much more active development, making it the stronger starting point for most teams. Reusing tested v4 code can still justify choosing it, while the scope of future compatibility work is uncertain.
- **Needed by many: 5.1** (likely 4.0 to 6.2)
  - Claude Opus 5.5 (5.5): Most developers who build web apps need sign-in and sessions. But next-auth is tied to Next.js, and the @auth/* packages for other frameworks are a small share of its use. That makes it narrower than the category as a whole.
  - GPT-6.2 Sol (4.6): Sign-in and sessions are common needs for web apps, and Next.js leads meta-framework usage in the State of JavaScript survey. The stable package targets Next.js, and the survey gives only an indirect measure of how many teams need this approach to authentication.
- **Helps a lot: 5.9** (likely 4.9 to 7.0)
  - Claude Opus 5.5 (5.0): v4 is mature and has a large set of OAuth providers and adapters. Its limits are clear: credentials (password) sign-in gets weak support, revoking a session needs a denylist you build yourself, edge use needs a split config, there is no enterprise SSO, and Next.js 16 brings friction. Better Auth now covers more features with better in-code configuration for most users.
  - GPT-6.2 Sol (6.8): Stable v4.24.15 handles common OAuth and session flows well, with TypeScript types and a database-free JWT option. Custom password flows take more work, and developers report difficulty finding examples for the right version. The separate v4 and v5 APIs make current examples easy for people and coding agents to mix up.
- **Holds up over time: 3.5** (likely 2.5 to 4.9)
  - Claude Opus 5.5 (3.0): The Better Auth team keeps it alive with security fixes. Only 26 commits landed in the last year, and v5 has no path to a stable release. The stated plan is to fold its stateless sessions into Better Auth, so the ecosystem is moving away from it. It is not abandoned, which keeps the score above the floor.
  - GPT-6.2 Sol (4.0): The Better Auth team has Vercel backing and has followed through on its promise to ship security fixes. Auth.js logged 26 commits and two next-auth npm versions in a year, with more than 200 pull requests open. The handoff gives existing apps a support path, while the limited roadmap leaves future Next.js compatibility harder to predict.
- **Used widely: 6.5** (likely 5.4 to 7.5)
  - Claude Opus 5.5 (7.0): 37.4M downloads in 4 weeks and 19,200 dependent repositories show a very large installed base. Its download ratio of about 4.2 is roughly at the median of 4.1, so it is holding share, not gaining. Better Auth grew about 42 times over the same year and now has about twice its downloads, so new projects are going elsewhere.
  - GPT-6.2 Sol (5.9): The collector found 19,200 dependent repositories and 304 packages, pointing to an installed base in the tens of thousands. Downloads grew 4.20×, just above the 4.1× catalog baseline and far behind Better Auth's roughly 42×. Repository stars cover multiple Auth.js packages, and repeat installs make it hard to estimate how many new projects chose next-auth.
- **Vouched for: 5.5** (likely 4.4 to 6.8)
  - Claude Opus 5.5 (5.0): It has years of production use and appears in Next.js templates and tutorials. Current independent write-ups now treat it as legacy or a migration path, and its own stewards recommend a different library. Recent HN attention is about the handoff, not about praise.
  - GPT-6.2 Sol (5.9): Cal.diy pins the current stable version, and the official Next.js dashboard course teaches NextAuth using the v5 beta. A recent independent comparison covers the beta too, while one developer reports keeping v4 for existing apps after migration friction. Current independent benchmarks and satisfaction data specific to stable v4 are sparse.
- **Safe: 5.5** (likely 4.5 to 6.9)
  - Claude Opus 5.5 (5.0): It has 14 advisories in total, five in the last 24 months, including a fail-open auth check and an email homoglyph bypass. Fixes shipped quickly on both lines. The Scorecard is 4.9, with weak marks for pinned dependencies, token permissions and code review. On the positive side it has 9 dependencies and an ISC licence. A security-critical library with recent fail-open bugs and a thin maintenance team carries real risk.
  - GPT-6.2 Sol (6.0): Version 4.24.15 patched the three July advisories that affected stable v4 by public disclosure, and an earlier v4 patch fixed email misdelivery. The permissive ISC license helps, and the package has nine direct dependencies. Token-based publishing and weak Scorecard results for token permissions and code review leave supply-chain concerns. The release commit has a verified signature, while the number of people with npm publish access is unclear.

## Good

- A very large set of built-in OAuth providers and database adapters, tested over years of production use.
- JWT sessions work with no database at all, which Better Auth only partly matches today.
- Security advisories are still triaged and fixed quickly on both the v4 and v5 lines.
- ISC licence, a small dependency tree and bundled TypeScript types.

## Bad

- It is in security-patch mode, and its own maintainers point new projects to Better Auth.
- v5 has been in beta for about three years with no date for a stable release, so `next-auth@latest` still installs v4.
- There is friction with Next.js 16 (the middleware-to-proxy rename), with edge setups that need a split config, and with peer dependencies.
- Five advisories in 24 months, several rated high or critical. The OpenSSF Scorecard is 4.9.

## The numbers

- Downloads, 4 weeks: 37M
- In a year: ×4.2
- GitHub stars: 28k
- Commits, 12 months: 26
- Last npm release: Jul 2026
- Advisories, 24 months: 5
- Licence: ISC
- GitHub: https://github.com/nextauthjs/next-auth
- npm: https://www.npmjs.com/package/next-auth

Auth.js was named NextAuth.js. The downloads are of the next-auth package only.

Scores run from 0 to 10 and are the mean of the scores of AI reviewers (Claude Opus 5.5, GPT-6.2 Sol), made on 21 November 2026 from GitHub, npm, OSV, OpenSSF Scorecard, ecosyste.ms, Hacker News and Bluesky data and a web search. The ecosyste.ms count of repositories that use a project is far too low for projects that grew in the last few years, and some reviews quote it. Overall is the reviewers' own judgement for a new project today, not an average of the parts. An AI wrote them and can be wrong.
