better-auth

Featured

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

Web & Frontend 221 stars 31 forks Updated today MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
78
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# 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)** ```bash bun add better-auth drizzle-orm drizzle-kit ``` **Option 2: Kysely** ```bash bun add better-auth kysely @noxharmonium/kysely-d1 ``` ### ⚠️ v1.4.0+ Requirements better-auth v1.4.0+ is **ESM-only**. Ensure: **package.json**: ```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: ```typescript // ✅ SIMPLEST - D1 native (v1.5.0+) import { betterAuth } from "better-auth"; const auth = betterAuth({ database: env.DB, // D1 binding, auto-detected }); ``` For complex schemas, use Drizzle ORM: ```typescript // ✅ RECOMMENDED for complex schemas - Drizzle import { drizzleAdapter } from "better-auth/adapters/drizzle"; import { drizzle } from "drizzle-orm/d1"; const auth = betterAuth({ database: drizzleAdapter(drizzle(env.DB, { schema }), { provider: "sqlite" }), }); ``` ```typescript // ❌ WRONG - This doesn't exist import { d1Adapter } from 'better-auth/adapters/d1' ``` ### Minimal Setup (Cloudflare Workers + Dri...

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
10 months ago
Last Updated
today
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category