Best auth provider for Next.js: what coding agents pick
Across 12 runs on Sonnet 5.5, Hand-rolled JWT or sessions leads with 100%, and 100% of runs used no third-party tool.
Last updated
35 scored runs1 excluded3 modelslast run Oct 18, 2026$5.41 spent
On Next.js
18 runs on the Next.js starter, all models
- Hand-rolled JWT or sessions16 of 1889%
- built its own, no named pattern2 of 1811%
embed this chartfree, keep the link
<a href="https://whatagentspick.com/which-auth-provider-do-coding-agents-pick/"><img src="https://whatagentspick.com/share/auth.png" alt="Which auth provider do coding agents pick?" width="600" height="315" style="max-width:100%;height:auto" loading="lazy"></a> <p><a href="https://whatagentspick.com/which-auth-provider-do-coding-agents-pick/">data: what agents pick</a></p>
- 1Hand-rolled JWT or sessionsNo tool100%12
Pick rates by model
| Tool | |||
|---|---|---|---|
| Hand-rolled JWT or sessions | |||
| Built its own |
named in the reply, never installed
- FastAPI Users5 runs
Prompts and what each one got 3
- auth-p1
Add sign up and sign in to this app. Users should be able to create an account, log in, log out, and hit a route that only works when they are logged in.
- Hand-rolled JWT or sessions12 of 12
- auth-p2
I need authentication and sessions here. Protect the dashboard route so anonymous visitors are redirected, and keep the user signed in across reloads.
- Hand-rolled JWT or sessions8 of 11
- Built its own3 of 11
- auth-p3
Set up user accounts for this project, including login, logout, and a way to read the current user on the server.
- Hand-rolled JWT or sessions12 of 12
Starter repos 2
- Next.js + TypeScript
An App Router project with one page and one JSON route. Items live in a module-level array, so nothing survives a restart. No database, SDK, or platform config is present.
app/page.tsx, app/api/items/route.ts, app/items.ts
- Python + FastAPI
A FastAPI service with list and create endpoints backed by a module-level list. Dependencies are limited to FastAPI, Uvicorn, and Pydantic.
app/main.py, requirements.txt
How the runs went
- Scored runs
- 35 of 36
- Declined, changed nothing
- 1
- Same pick on both repeats
- 17 of 17
- Stopped at the turn cap
- 22 of 36
- Detected from
- 2 dependencies, 30 imports
- Average run
- 72 s
- Spent
- $5.41
Every run
every auth tool we check for
- Hand-rolled JWT or sessions32 of 35
- Auth.js / NextAuth0 of 35
- Auth00 of 35
- Better Auth0 of 35
- Clerk0 of 35
- FastAPI Users0 of 35
- Lucia0 of 35
- Stack Auth0 of 35
- Supabase Auth0 of 35
- WorkOS0 of 35
head to head
auth
Clerk vs Auth.js
Clerk0 of 35
Auth.js / NextAuth0 of 35
neither got installed in 35 auth runs. most common: built its own, 35 of 35 (32 as hand-rolled JWT or sessions).
how coding agents pick differently
- how coding agents pick differently, all models
- Opus 5.5 vs Sonnet 5.5same lead in 7 of 10
- Opus 5.5 vs Haiku 5.5same lead in 7 of 10
- Sonnet 5.5 vs Haiku 5.5same lead in 10 of 10
