
Better Auth
This drops Better Auth into Claude Code projects when you need authentication that actually works with Cloudflare D1 and modern TypeScript stacks. It's built for self-hosting across 15+ frameworks (Next.js, Nuxt, Workers, Remix) and includes OAuth, 2FA, passkeys, RBAC, and multi-tenant setups. The skill prevents about 20 common errors, mostly around D1 adapter confusion (there's no d1Adapter, you use Drizzle or pass the binding directly in v1.5+) and ESM-only requirements since v1.4. It's a solid Clerk alternative if you want control over your auth stack. The documentation makes migration straightforward, and the new CLI tools in v1.5 handle schema generation and upgrades cleanly.
- skills.sh installs
- 502
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill better-auth --agent claude-codeInstalls into .claude/skills of the current project.
Files
better-auth
Status: Production Ready
Last Updated: 2026-04-08
Package: better-auth@1.6.0 (ESM-only)
Dependencies: Drizzle ORM or Kysely (required for D1 complex use cases; D1 native support available in v1.5+)
Quick Start (5 Minutes)
Installation
Option 1: Drizzle ORM (Recommended)
bun add better-auth drizzle-orm drizzle-kit
Option 2: Kysely
bun add better-auth kysely @noxharmonium/kysely-d1
⚠️ v1.4.0+ Requirements
better-auth v1.4.0+ is ESM-only. Ensure:
package.json:
{
"type": "module"
}
Upgrading from v1.3.x? Load references/migration-guide-1.4.0.md
Upgrading from v1.4.x? Load references/migration-guide-1.5.0.md
⚠️ CRITICAL: D1 Adapter Requirements
v1.5.0+: D1 is now natively supported. Pass your D1 binding directly:
// ✅ SIMPLEST - D1 native (v1.5.0+)
import { betterAuth } from "better-auth";
const auth = betterAuth({
database: env.DB, // D1 binding, auto-detected
});
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Frontend Development, Backend & APIs, Security, Cloud & Infrastructure
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Design System Creation500
- React Composition Patterns494
- Api Contract Testing491
- React Native Skills490
- Technical Specification489
- Mobile App Testing480
- Api Design Principles479
- Frontend Design479
- Threejs477
- Csrf Protection474
- Ml Model Training474
- Payment Gateway Integration469
- Test Quality Analysis469
- Api Reference Documentation465
- Tanstack Router461
- Systematic Debugging457
- Interaction Design456
- Mutation Testing456
- Api Error Handling455
- Internationalization I18n455
- Security Headers Configuration454
- Seo Optimizer453
- Sequential Thinking448
- Bun Sqlite442