File: introduction.md | Updated: 11/15/2025
🎉 NextAuth.js is now part of Better Auth !
This is documentation for NextAuth.js v3, which is no longer actively maintained.
For up-to-date documentation, see the **latest version ** (v4).
Version: v3
On this page
About NextAuth.js
NextAuth.js is a complete open source authentication solution for Next.js applications.
It is designed from the ground up to support Next.js and Serverless.
Check out the example code to see how easy it is to use NextAuth.js for authentication.
Designed to work with any OAuth service, it supports OAuth 1.0, 1.0A and 2.0
Built-in support for many popular sign-in services
Supports email / passwordless authentication
Supports stateless authentication with any backend (Active Directory, LDAP, etc)
Supports both JSON Web Tokens and database sessions
Designed for Serverless but runs anywhere (AWS Lambda, Docker, Heroku, etc…)
NextAuth.js can be used with or without a database.
An open source solution that allows you to keep control of your data
Supports Bring Your Own Database (BYOD) and can be used with any database
Built-in support for MySQL, MariaDB, Postgres, SQL Server, MongoDB and SQLite
Works great with databases from popular hosting providers
Can also be used without a database (e.g. OAuth + JWT)
Note: Email sign in requires a database to be configured to store single-use verification tokens.
encryption: true (defaults to A256GCM)Advanced options allow you to define your own routines to handle controlling what accounts are allowed to sign in, for encoding and decoding JSON Web Tokens and to set custom cookie security policies and session properties, so you can control who is able to sign in and how often sessions have to be re-validated.
Credits
NextAuth.js is an open source project that is only possible thanks to contributors .
Getting Started
Check out the example code to see how easy it is to use NextAuth.js for authentication.