talira

Authentication for the Web, formerly NextAuth.js

open sourceISCself-hostablefree

Auth.js (NextAuth.js for Next.js) is a set of open-source TypeScript packages for adding authentication to web apps in any JavaScript framework and runtime, built on standard Web APIs: next-auth for Next.js and @auth packages for SvelteKit, Express, Qwik and others. It signs users in with any OAuth 2.0 or OIDC service and has many built-in providers, plus email/passwordless sign-in and passkeys (WebAuthn). It works with a database through adapters for MySQL, MariaDB, Postgres, SQL Server, MongoDB, SQLite and more, or without one using stateless sessions in encrypted JWTs (JWE). It uses CSRF tokens, restrictive cookie policies and tab syncing by default, and callbacks control who can sign in and what goes in sessions. The project is now part of Better Auth, which recommends Better Auth for new projects except where Auth.js's stateless, database-less sessions are needed.

Problems it solves

  • add sign in with GitHub or Google to my Next.js app
  • authentication in SvelteKit or Express without a hosted auth service
  • passwordless magic link login for a web app
  • keep user accounts in our own database instead of a third-party auth provider
  • stateless sessions without a database
  • add passkeys to a JavaScript web app
  • plug any OAuth or OIDC provider into our app's login

Features

  • OAuth 2.0 and OIDC with many built-in providers
  • email and passwordless sign-in
  • passkeys (WebAuthn)
  • database adapters for MySQL, MariaDB, Postgres, SQL Server, MongoDB, SQLite and more
  • stateless JWT sessions encrypted with JWE
  • CSRF protection and restrictive cookies
  • callbacks for sign-in, JWT and session control
  • packages for Next.js, SvelteKit, Express, Qwik and more

Capabilities

Takes pluginsplan not known
Has official SDKsplan not known

Alternatives

The same job

These do what Auth.js does.

  1. Better Auth The most comprehensive authentication framework for TypeScript
  2. Clerk Drop-in authentication and user management with prebuilt UI components

Compare Auth.js with the top 3