What problem does it solve?
This skill provides a comprehensive blueprint and tooling guidance to build secure, self-hosted authentication systems on Cloudflare Workers using D1 with Drizzle ORM or Kysely, including 2FA, SSO, organizations, and RBAC.
Core Features & Use Cases
- D1-based auth scaffolding: Quick-start setup that wires Drizzle/Kysely to Cloudflare D1 for user, session, and account management.
- Multi-tenant & RBAC: Organize users into organizations and teams with role-based access controls.
- OAuth/OIDC & Social Sign-In: Integrates social login providers and OpenID Connect flows with secure session handling.
- Secure sessions & migrations: Stateless or KV-backed sessions, JWT rotation, and migration guidance for D1 schemas.
- Use Case: Migrate an existing Clerk-based app to a self-hosted authentication system with organization-wide access control and single sign-on.
Quick Start
Use the included setup script to bootstrap a Cloudflare Worker with better-auth and D1, then customize your OAuth providers and session strategy.