Auth.js
Keep, but not for new work. 8th of 10 authentication libraries.
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
Overall4.0
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 3.5, likely 2.5 to 4.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.
- better-auth.com/blog/authjs-joins-better-auth: The official advice for new projects is Better Auth.
- blog.logrocket.com/best-auth-library-nextjs-2026: An independent comparison calls Auth.js a migration bridge.
- github.com/nextauthjs/next-auth/discussions/13382: Users get no answer on when v5 will be stable.
- peers Better Auth: Better Auth has 2x the downloads and 100x the commits.
GPT-6.2 Sol: 4.4, likely 3.4 to 5.6
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.
- next-auth.js.org/getting-started/introduction: Stable v4 covers common Next.js sign-in and session needs.
- better-auth.com/blog/authjs-joins-better-auth: The maintainers prioritize urgent fixes and direct new projects to Better Auth.
- better-auth.com/docs/concepts/session-management#stateless-session-management: Better Auth now documents OAuth sessions without a database.
- better-auth.com/docs/introduction: Better Auth is framework-agnostic and offers built-in password auth and plugins.
- github.com/nextauthjs/next-auth/releases/tag/next-auth@4.24.15: The current v4 release delivers security fixes for existing installs.
- github commitsLastYear, peers Better Auth: Auth.js recorded 26 commits against Better Auth's 2,967 over the same year.
Needed by many5.1
How many developers need a tool for this job?
Claude Opus 5.5: 5.5, likely 4.5 to 6.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.
- next-auth package scope: next-auth targets Next.js. Other frameworks use separate @auth/* packages.
- blog.logrocket.com/best-auth-library-nextjs-2026: Discussed as a Next.js-specific choice.
GPT-6.2 Sol: 4.6, likely 3.5 to 5.8
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.
- 2025.stateofjs.com/en-US/libraries/meta-frameworks: Next.js leads usage among surveyed meta-frameworks.
- next-auth.js.org/getting-started/introduction: Stable v4 is designed for Next.js.
Helps a lot5.9
How well does it do the job for those who need it?
Claude Opus 5.5: 5.0, likely 4.0 to 6.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.
- blog.logrocket.com/best-auth-library-nextjs-2026: Lists the session, edge, Next.js 16, Prisma 7 and SSO limits, and calls it a migration bridge.
- github.com/nextauthjs/next-auth/discussions/13382: Users report three years of v5 betas and still need --legacy-peer-deps.
- npm hasTypes: Ships TypeScript types.
GPT-6.2 Sol: 6.8, likely 5.7 to 7.9
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.
- next-auth.js.org/getting-started/introduction: Documents providers, email sign-in, and both session strategies.
- next-auth.js.org/getting-started/typescript: Ships types for sessions, tokens, and adapters.
- next-auth.js.org/providers/credentials: Credential validation is application code and requires JWT sessions.
- next-auth.js.org/configuration/nextjs: Documents stable v4 server sessions for both Next.js routers.
- reddit.com/r/nextjs/comments/1rv1q0e/learning_nextjs_whats_the_best_authentication: A developer reports a rough v4-to-v5 migration and confusing version guidance.
Holds up over time3.5
Will it still be a good choice in two years?
Claude Opus 5.5: 3.0, likely 2.0 to 4.5
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.
- better-auth.com/blog/authjs-joins-better-auth: Security patches and urgent fixes only. New projects are told to use Better Auth.
- github commitsLastYear: 26 commits, against 2967 for Better Auth.
- scorecard Maintained: The Maintained check scores 0.
- better-auth.com/blog/security-update-july-2026: A dedicated security-review workstream still covers Auth.js.
GPT-6.2 Sol: 4.0, likely 2.9 to 5.3
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.
- github commitsLastYear, releasesLastYear, openIssues, openPullRequests: 26 commits, 62 repository-wide releases, 394 open issues, and 216 open PRs.
- npm versionsLastYear, latestPublishedAt: Two next-auth versions in the last year, with the latest in July 2026.
- github.com/nextauthjs/next-auth/discussions/13252: Maintainers acknowledge the slowdown and commit to security and urgent fixes.
- vercel.com/blog/vercel-acquires-better-auth: Vercel acquired Better Auth and brought its core team on board.
- github.com/nextauthjs/next-auth/releases/tag/next-auth@4.24.15: The July stable release shipped security and compatibility fixes.
Used widely6.5
How many use it, and is that growing?
Claude Opus 5.5: 7.0, likely 6.0 to 8.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.
- npm downloadsLast4Weeks: 37.4M, against 8.9M a year before, a ratio of about 4.2.
- medianDownloadsRatio: The median is 4.1, so it is flat in relative terms.
- dependents repos: 19,200 repositories.
- peers Better Auth downloadsLast4Weeks: 76.1M, up from 1.8M.
GPT-6.2 Sol: 5.9, likely 4.8 to 7.0
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.
- dependents repos, packages: 19,200 indexed repositories and 304 dependent packages.
- npm downloadsLast4Weeks, downloadsSame4WeeksYearAgo, medianDownloadsRatio: 37.4 million versus 8.9 million downloads, slightly ahead of the catalog baseline.
- peers Better Auth, Passport: Better Auth grew about 42×, while Passport has far more indexed dependents.
- project note, github stars, bluesky posts, hackerNews top: 28,389 shared-repository stars, two Bluesky links, and leading HN attention on the handoff.
Vouched for5.5
Who stands behind it being good?
Claude Opus 5.5: 5.0, likely 4.0 to 6.5
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.
- hackerNews top: The top story is 'Auth.js is now part of Better Auth' (179 points).
- blog.logrocket.com/best-auth-library-nextjs-2026: Best fit given as migrating existing v4 codebases only.
- github stars: 28.4k stars, 906 contributors.
GPT-6.2 Sol: 5.9, likely 4.7 to 7.0
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.
- github.com/calcom/cal.diy/blob/main/apps/web/package.json: The scheduling application's web package pins next-auth 4.24.15.
- nextjs.org/learn/dashboard-app/adding-authentication: The official Next.js course teaches NextAuth v5 beta for the App Router.
- we.inc/guides/nextjs-authentication: Independent comparison covers setup and session storage using the v5 beta.
- reddit.com/r/nextjs/comments/1rznpyt/migrating_to_better_auth_from_next_auth_and_its_a: A developer kept existing apps on v4 after trying the migration.
Safe5.5
How safe is it to depend on?
Claude Opus 5.5: 5.0, likely 4.0 to 6.5
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.
- advisories recent: Four advisories published in July 2026, two marked critical.
- better-auth.com/blog/security-update-july-2026: All fixed in 4.24.15 and 5.0.0-beta.32.
- scorecard score: 4.9 overall, with Pinned-Dependencies and Token-Permissions at 0.
- npm dependencies: 9 dependencies, ISC licence.
GPT-6.2 Sol: 6.0, likely 4.9 to 7.2
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.
- github.com/nextauthjs/next-auth/releases/tag/next-auth@4.24.15: Documents the three v4 fixes and shows a verified release commit.
- github.com/nextauthjs/next-auth/security/advisories/GHSA-8fpg-xm3f-6cx3: The July configuration advisory covers the v5 beta only.
- github.com/nextauthjs/next-auth/security/advisories/GHSA-5jpx-9hw9-2fx4: The earlier email misdelivery issue was fixed in 4.24.12.
- github.com/nextauthjs/next-auth/blob/v4/.github/workflows/release.yml: The v4 release workflow publishes through GitHub Actions using npm token secrets.
- npm license, dependencies: Permissive ISC license and nine direct dependencies.
- scorecard score, checks: 4.9 overall, with token permissions at 0 and code review at 3.
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
- npm downloads, 4 weeks
- 37M ×4.2 in a year
- GitHub stars
- 28k
- Commits, 12 months
- 26
- npm version
- 4.24.15 Jul 2026
- Versions, 12 months
- 2
- Advisories, 24 months
- 5 of 14 ever
- OpenSSF Scorecard
- 4.9 out of 10, Oct 2026
- Licence
- ISC
Auth.js was named NextAuth.js. The downloads are of the next-auth package only.
Read on 21 November 2026 from GitHub (nextauthjs/next-auth), npm (next-auth), OSV and the OpenSSF Scorecard.
Authentication libraries
- 8.5Better Auth
- 8.3jose
- 7.9openid-client
- 6.8iron-session
- 6.3SuperTokens
- 5.2jsonwebtoken
- 4.9Passport
- 4.0Auth.js
- 1.6Arctic
- 1.6Lucia