Better Auth vs Clerk
In 4,864 JavaScript/TypeScript projects set up for AI coding agents, Better Auth is a dependency in 104 (2.1%) and Clerk in 58 (1.2%): Better Auth is 1.8× as common. Among repos created in the last 90 days that use a auth and security libraries tool, Better Auth is in 20.0% and Clerk in 5.7%, against 11.3% and 6.5% of older ones. No project in the scan lists both: projects pick one.
Auth and security libraries npm Updated Nov 17, 2026
| Better Auth | 2.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
| Better Auth | Clerk | |
|---|---|---|
| Agent projects that use it | 104 | 58 |
| Rank in auth and security libraries | #7 | #11 |
| In new repos with a auth and security libraries tool (last 90 days) | 20.0% | 5.7% |
| In older repos with one | 11.3% | 6.5% |
| Downloads, last 7 days | 20M | 3.8M |
| GitHub stars | 30.8K | 1,782 |
| Last push to its repo | Nov 17, 2026 | Nov 17, 2026 |
| License | MIT | MIT |
| Funding | — | — |
| Projects that list both | 0 | |
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 | Better Auth | Clerk |
|---|---|---|---|
| Claude Code | 2,617 | 2.1% | 1.0% |
| GitHub Copilot | 2,350 | 2.4% | 1.1% |
| Cursor | 1,990 | 2.3% | 1.7% |
| Gemini CLI | 422 | 1.7% | 1.4% |
| OpenAI Codex | 409 | 2.0% | 1.5% |
| OpenCode | 304 | 5.3% | 0% |
| Devin Desktop | 231 | 2.2% | 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.
Better Auth
Comprehensive authentication framework for TypeScript with multiple strategies.
Most often used with it:
| Tailwind Merge | 77.9% of its projects |
|---|---|
| clsx | 76.9% of its projects |
| Lucide React | 77.9% of its projects |
| Class Variance Authority | 72.1% of its projects |
| tw-animate-css | 68.3% of its projects |
npm install better-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 AuthNextAuth.js 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.