# Auth\.js

Open\-source JavaScript authentication packages with provider integrations and JWT or database sessions; now maintained by the Better Auth team\.

ID: Q770 · Revision: 818

Type: software · License: ISC[^license] · Status: active

Website: https://authjs.dev/



Auth\.js is a family of open\-source authentication packages, including the NextAuth\.js integration for Next\.js\. It provides identity\-provider integration and configurable session strategies rather than a hosted identity service\. The Better Auth team maintains the project for security patches and urgent issues and recommends Better Auth for most new projects, making existing\-application requirements especially important when evaluating it\.[^readme][^handoff]

## Integration into an existing application

Auth\.js packages use standard web APIs and expose framework\-specific integration points\. The repository documents OAuth/OIDC providers, passwordless email and configurable persistence, allowing account data to remain under the application's control\. In an existing project, the relevant unit is the actual package and version being used, not simply the Auth\.js brand\. A generated snippet written for a different framework integration or major NextAuth\.js version may not match that application's handlers and session helpers\.[^readme][^v5]

## The credentials provider is an integration point

The Credentials provider passes submitted input to developer\-defined authentication logic\. It does not persist credential data by default, and the documentation explicitly leaves necessary storage, password processing, rate limiting and recovery functionality to that implementation\. Returning a user object or rejecting credentials is only part of a complete account lifecycle\. For a vibecoder, this is an important distinction from a library that already implements password\-account management: a working sign\-in form does not establish that the missing surrounding logic exists\.[^credentials]

## Choosing a session strategy

Auth\.js supports JWT sessions and database\-backed sessions\. JWT sessions avoid a session database but have a revocation tradeoff: removing the current cookie does not invalidate a token copied elsewhere before its encoded expiry\. Immediate invalidation requires additional server\-side tracking\. Database sessions instead resolve an opaque cookie identifier through stored records and make server\-side session changes more direct, at the cost of database operations and adapter requirements\. The appropriate choice follows the application's logout and access\-revocation needs\.[^session]

## Version and runtime boundaries

The inspected NextAuth\.js v5 upgrade guide still installs through the beta tag and documents changed authentication helpers, adapter package names and stricter provider compatibility\. Its edge\-runtime guidance warns that an ORM or database adapter may not run where the core web\-API\-based library does\. Separately, the security policy limits updates to the current latest version and says non\-adapter @auth packages are under development unless specifically stated otherwise\. These distinctions prevent a broad compatibility claim from becoming an assurance about every package/version combination\.[^v5][^security]

## Current maintenance direction

The September 2025 handoff announcement promises security patches and urgent\-issue handling for Auth\.js while recommending Better Auth for new work\. Its original discussion mentioned database\-free sessions as a possible reason to stay; the currently inspected migration guide now says Better Auth supports stateless sessions too\. That older gap should therefore not be repeated as a current exclusive Auth\.js feature\. Existing users with a working configuration are not told to migrate urgently, but new adoption should account for the stated maintenance direction\.[^handoff][^migration]

## License and substitution

Auth\.js uses the ISC license\. It overlaps with [Better Auth](/betterauth) in authentication integration, but their APIs and database models differ\. The documented migration changes client helpers and server handlers as well as schema details such as email\-verification representation and session field names\. This supports a task\-specific comparison, not a claim that either can consume the other's stored state unchanged\. Maintaining an existing Auth\.js deployment and choosing a starting point for a new product are different decisions\. No migration or security audit was performed for this article\.[^license][^migration]

## Capabilities and substitutions

### Provider\-based authentication — supported

Open\-source packages integrate OAuth/OIDC and other sign\-in mechanisms using application\-owned configuration\.[^readme]

Use case: Authentication integration in existing JavaScript web applications · Platforms: JavaScript web servers, Next\.js, SvelteKit, Express, Qwik · Region: Version, build and integration requirements apply

### Turnkey password account lifecycle — limited

Credentials forwards input to custom authorize logic; persistence, password handling, reset and abuse controls require application implementation\.[^credentials]

Use case: Authentication integration in existing JavaScript web applications · Platforms: JavaScript web servers, Next\.js, SvelteKit, Express, Qwik · Region: Version, build and integration requirements apply

### JWT session revocation — limited

Deleting a browser cookie does not invalidate another saved JWT before expiry without additional server\-side revocation tracking\.[^session]

Use case: Authentication integration in existing JavaScript web applications · Platforms: JavaScript web servers, Next\.js, SvelteKit, Express, Qwik · Region: Version, build and integration requirements apply

### Uniform production readiness — limited

The v5 guide uses a beta tag; the security page warns that non\-adapter @auth packages remain under development unless otherwise stated\.[^v5][^security]

Use case: Authentication integration in existing JavaScript web applications · Platforms: JavaScript web servers, Next\.js, SvelteKit, Express, Qwik · Region: Version, build and integration requirements apply

### [Substitute for Better Auth](/betterauth) — limited

Can address overlapping authentication needs, particularly in existing integrations, but maintainers recommend Better Auth for most new projects\. APIs and schemas are not interchangeable\.[^readme][^migration]

Use case: Authentication integration in existing JavaScript web applications · Platforms: JavaScript web servers, Next\.js, SvelteKit, Express, Qwik · Region: Version, build and integration requirements apply

## References

[^readme]: [Auth\.js repository README](<https://github.com/nextauthjs/next-auth/blob/main/README.md>) — Package family, providers and maintainer recommendation (vendor; retrieved 2026-10-07T22:40:58Z)

[^license]: [Auth\.js source license](<https://github.com/nextauthjs/next-auth/blob/main/LICENSE>) — ISC notice and permission terms (vendor; retrieved 2026-10-07T22:41:06Z)

[^handoff]: [Auth\.js joins Better Auth](<https://better-auth.com/blog/authjs-joins-better-auth>) — September 22, 2025 maintenance commitment and new\-project recommendation (vendor; retrieved 2026-10-07T22:41:13Z)

[^credentials]: [Auth\.js credentials provider](<https://authjs.dev/getting-started/authentication/credentials>) — Custom authorize logic and absent default persistence/recovery/rate limiting (vendor; retrieved 2026-10-07T22:41:06Z)

[^session]: [Auth\.js session strategies](<https://authjs.dev/concepts/session-strategies>) — JWT/database tradeoffs, revocation and adapter compatibility (vendor; retrieved 2026-10-07T22:41:06Z)

[^v5]: [NextAuth\.js v5 upgrade guide](<https://authjs.dev/getting-started/migrating-to-v5>) — Beta installation, changed APIs and adapter/edge caveats (vendor; retrieved 2026-10-07T22:40:58Z)

[^security]: [Auth\.js security policy](<https://authjs.dev/security>) — Latest\-version update policy and development status of non\-adapter @auth packages (vendor; retrieved 2026-10-07T22:41:13Z)

[^migration]: [Auth\.js to Better Auth migration](<https://authjs.dev/getting-started/migrate-to-better-auth>) — Migration work, schema differences and current stateless Better Auth support (vendor; retrieved 2026-10-07T22:41:13Z)

Source revision: https://substitutefor.net/entities/Q770?revision=818
