Skip to content
FindOpenSource

Auth.js

Open-source authentication library built on standard Web APIs, supporting OAuth, email/passwordless and credential-based sign-in for any JavaScript framework or runtime.

Overview

Auth.js (formerly NextAuth.js) is a set of open-source authentication packages built on standard Web APIs, designed to work with any JavaScript framework, runtime, or hosting model - including serverless and Docker deployments, not just Next.js.

It supports OAuth 2.0 and OpenID Connect out of the box, along with email/passwordless sign-in and Passkeys/WebAuthn, and can be used with or without a database: when a database is used, official adapters cover Postgres, MySQL, MariaDB, SQL Server, MongoDB, SQLite and more. Security defaults include CSRF protection, encrypted JSON Web Tokens, and restrictive cookie policies aligned with OWASP guidance.

Auth.js is a good fit for teams that want to own their authentication data and logic directly in their application rather than depending on a hosted identity provider. Its official README notes that the project is now part of Better Auth, and recommends new projects start there unless they specifically need Auth.js's stateless, database-optional session handling.

Categories
Authentication & Security
Keywords
authenticationoauthsessionnextjsjwtssologin
Languages
TypeScript
License
ISC

Spotted an error? Suggest an edit on GitHub.