better-auth
CommunitySelf-hosted TS auth for Cloudflare Workers.
AuthorHieubkav
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Provides production-ready authentication for TypeScript with Cloudflare Workers, including D1 support via Drizzle ORM or Kysely. It’s a self-hosted alternative to Clerk or Auth.js and supports social providers, email/password, magic links, 2FA, passkeys, organizations, and RBAC. Note: CRITICAL: There is no direct d1Adapter()—use Drizzle or Kysely.
Core Features & Use Cases
- Cloudflare Workers + D1 integration with Drizzle ORM or Kysely
- Social providers (Google, GitHub, Microsoft, etc.)
- Email/password with verification and magic links
- Two-factor authentication and passkeys
- Organization/multi-tenant RBAC and permissions
- Migration guides from Clerk and Auth.js
- Robust session management, rate limiting, and security hardening
Quick Start
Pick Drizzle ORM (recommended) or Kysely with D1, install dependencies, wire up Cloudflare Workers, configure environment vars, and run a sample flow (signup/signin) using the included references.
Dependency Matrix
Required Modules
better-authdrizzle-ormdrizzle-kit@cloudflare/workers-typeshonokyselykysely-d1
Components
scriptsreferencesassets
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: better-auth Download link: https://github.com/Hieubkav/wincellarCloneBackend/archive/main.zip#better-auth Please download this .zip file, extract it, and install it in the .claude/skills/ directory.