NextAuth.js vs Clerk
In 4,864 JavaScript/TypeScript projects set up for AI coding agents, NextAuth.js is a dependency in 151 (3.1%) and Clerk in 58 (1.2%): NextAuth.js is 2.6× as common. Among repos created in the last 90 days that use a auth and security libraries tool, NextAuth.js is in 8.6% and Clerk in 5.7%, against 17.2% and 6.5% of older ones. 5 projects list both, often a sign of a migration or of a monorepo with several apps.
Auth and security libraries npm Updated Nov 17, 2026
| NextAuth.js | 3.1% | |
|---|---|---|
| Clerk | 1.2% |
Share of 4,864 JavaScript/TypeScript projects set up for AI coding agents that list each one as a dependency.
Side by side
| NextAuth.js | Clerk | |
|---|---|---|
| Agent projects that use it | 151 | 58 |
| Rank in auth and security libraries | #2 | #11 |
| In new repos with a auth and security libraries tool (last 90 days) | 8.6% | 5.7% |
| In older repos with one | 17.2% | 6.5% |
| Downloads, last 7 days | 9.4M | 3.8M |
| GitHub stars | 28.4K | 1,782 |
| Last push to its repo | Jul 22, 2026 | Nov 17, 2026 |
| License | ISC | MIT |
| Funding | Yes | — |
| Projects that list both | 5 | |
Downloads include CI runs and installs as a dependency of other packages. Stars and pushes are from GitHub's API; downloads from npm.
By coding agent
| Projects set up for | JavaScript/TypeScript repos | NextAuth.js | Clerk |
|---|---|---|---|
| Claude Code | 2,617 | 2.7% | 1.0% |
| GitHub Copilot | 2,350 | 3.7% | 1.1% |
| Cursor | 1,990 | 3.1% | 1.7% |
| Gemini CLI | 422 | 2.4% | 1.4% |
| OpenAI Codex | 409 | 2.7% | 1.5% |
| OpenCode | 304 | 2.0% | 0% |
| OpenClaw | 241 | 2.1% | 0% |
| Devin Desktop | 231 | 3.5% | 4.8% |
| Roo-Code | 90 | 0% | 8.9% |
Share of the JavaScript/TypeScript repos configured for each agent (its config file in the repo) that list the tool. A repo set up for two agents counts for both.
NextAuth.js
Complete open-source authentication solution designed for Next.js applications.
Most often used with it:
| Next.js | 99.3% of its projects |
|---|---|
| Lucide React | 83.4% of its projects |
| clsx | 82.1% of its projects |
| Tailwind Merge | 78.8% of its projects |
| React | 99.3% of its projects |
npm install next-auth
Clerk
Modern authentication and user management SDK for Next.js and React.
Most often used with it:
| Lucide React | 77.6% of its projects |
|---|---|
| Class Variance Authority | 69.0% of its projects |
| Next.js | 70.7% of its projects |
| Tailwind Merge | 72.4% of its projects |
| React | 94.8% of its projects |
npm install @clerk/nextjs
More matchups
NextAuth.js vs Better AuthBetter Auth vs Clerkjsonwebtoken vs josebcryptjs vs bcrypt (JavaScript)PyJWT vs python-josepasslib vs bcrypt (Python)
How we count
Projects are public GitHub repos our weekly scan finds through coding-agent config files (CLAUDE.md, AGENTS.md, .cursor/mcp.json and others); a project uses a tool when its package.json, requirements.txt or pyproject.toml lists it. "Same job" was checked for every pair, so add-ons and companions are never paired. Shares by repo age compare repos created in the last 90 days with older ones in the same scan. More on the method.