NextAuth.js
Complete open-source authentication solution designed for Next.js applications.
Auth and security libraries npm ISC
Used in agent projects
266
2.1% of 12,697 public repos built with AI coding agents
Rank in auth and security libraries
#1 of 47
by use in those projects
Downloads
6.7M
npm, last 7 days, next-auth
GitHub stars
28.4K
last push Jul 22, 2026
How NextAuth.js is used
NextAuth.js is a dependency in 266 of the 12,697 public GitHub projects set up for AI coding agents that we scanned (2.1%), #1 of 47 in auth and security libraries. The most used alternative there is bcryptjs. Projects that use it most often also use Next.js (99.2%), clsx (71.1%), Tailwind Merge (69.2%).
Often used with NextAuth.js
| Next.js | 99.2% of NextAuth.js projects · 4.4× more than average |
|---|---|
| clsx | 71.1% of NextAuth.js projects · 4.0× more than average |
| Tailwind Merge | 69.2% of NextAuth.js projects · 4.1× more than average |
| Tailwind CSS | 94.4% of NextAuth.js projects · 2.7× more than average |
| Class Variance Authority | 61.3% of NextAuth.js projects · 4.3× more than average |
| Lucide React | 68.8% of NextAuth.js projects · 3.5× more than average |
| React | 99.2% of NextAuth.js projects · 2.3× more than average |
| Radix UI | 56.8% of NextAuth.js projects · 4.7× more than average |
By coding agent
| GitHub Copilot | 2.9% of projects set up for it |
|---|---|
| Claude Code | 2.1% of projects set up for it |
| Cursor | 2.6% of projects set up for it |
| OpenAI Codex | 2.7% of projects set up for it |
| Gemini CLI | 2.3% of projects set up for it |
| Devin Desktop | 2.9% of projects set up for it |
| OpenCode | 1.9% of projects set up for it |
Share of public repos configured for each agent that list NextAuth.js as a dependency.
Install
| Package | npm install next-auth |
|---|---|
| Main stacks | Next.js (261), TypeScript / JavaScript (5) |
| Example projects | veithly/BountyBoard, ask-the-hive/the-hive, EricTechPro/match-me, Ranork/remnus-app, amirardalan/portfolio |
Alternatives to NextAuth.js
| Tool | Used in agent projects | Downloads / wk | GitHub stars | License |
|---|---|---|---|---|
| bcryptjs npm Pure JavaScript bcrypt implementation for secure password hashing without dependencies. |
256 (2.0%) | 14.7M | 3,797 | BSD-3-Clause |
| jsonwebtoken npm Create, verify and decode JSON Web Tokens for authentication and secure data transmission. |
241 (1.9%) | 59.3M | 18.2K | MIT |
| cryptography pypi Python library providing cryptographic recipes and primitives for secure applications. |
213 (1.7%) | 281M | 7,803 | — |
| jose npm Comprehensive JWT and JWK handling for Node.js and web runtimes. |
141 (1.1%) | 151M | 7,824 | MIT |
| PyJWT pypi Python library for encoding and decoding JSON Web Tokens. |
128 (1.0%) | 154M | 5,714 | — |
| Better Auth npm Comprehensive authentication framework for TypeScript with multiple strategies. |
126 (1.0%) | 11.4M | 30.2K | MIT |
| Helmet npm Express middleware that sets HTTP security headers to prevent vulnerabilities. |
125 (1.0%) | 16.2M | 10.7K | MIT |
| Privy Auth npm React authentication SDK enabling Web2 and Web3 logins with embedded wallets. |
107 (0.8%) | 430K | — | Apache-2.0 |