NextAuth.js
Authentication for Next.js
JS/TS
#17
Overall Rank
of 20 tools
31.2%
Pick Rate
34 of 109 (CI: 23.3–40.4%)
34
Primary Picks
of 109 extractable
3
Alt Picks
also mentioned 2x
Competitive
Category Tier
47.7% winner dominance
In Authentication
Full comparison →Custom/DIY52/109 (47.7%) CI: 38.6–57%
NextAuth.js34/109 (31.2%) CI: 23.3–40.4%
Supabase Auth12/109 (11%) CI: 6.4–18.3%
By Model
Sonnet 4.5
80%
avg across repos
Opus 4.5
92.9%
avg across repos
Opus 4.6
100%
avg across repos
How Claude Code Picks NextAuth.js
Opus 4.5 · TaskFlow (Next.js SaaS)
Prompt
“add user authentication”
Response (abbreviated)
NextAuth.js (Auth.js v5) is the standard for Next.js authentication. I'll set up email/password and GitHub OAuth.
bash
pnpm add next-auth@beta @auth/drizzle-adaptertypescript
// auth.ts
import NextAuth from 'next-auth';
import GitHub from 'next-auth/providers/github';
import Credentials from 'next-auth/providers/credentials';
import { DrizzleAdapter } from '@auth/drizzle-adapter';
import { db } from './lib/db';
export const { handlers, signIn, signOut, auth } = NextAuth({
adapter: DrizzleAdapter(db),
providers: [GitHub, Credentials({ /* ... */ })],
pages: { signIn: '/login' },
});I'm adding middleware to protect routes, a login page, and session management in your layout...
Per-Repo Breakdown
| Repo | Stack | Sonnet | Opus 4.5 | Opus 4.6 |
|---|---|---|---|---|
TaskFlowJS/TS | Next.js 14, TypeScript, App Router | 80% | 92.9% | 100% |
Key Insight
Agents prefer building auth themselves. NextAuth.js dominates in Next.js (91%), but Python builds JWT from scratch 100% of the time. The winner depends entirely on your stack.
Frequently Asked Questions
- Does Claude Code recommend NextAuth.js?
- NextAuth.js appears in 31.2% of Authentication responses. It competes with Custom/DIY (47.7%) in this category.
- What authentication tool does Claude Code prefer?
- Custom/DIY leads at 47.7%. The category is classified as "Competitive" (<50% dominance). Other options include NextAuth.js (31.2%) and Supabase Auth (11%).
- How do different Claude models compare on NextAuth.js?
- Across repos, Sonnet 4.5 averages 80%, Opus 4.5 averages 92.9%, and Opus 4.6 averages 100% for NextAuth.js.