better-auth

Set up self-hosted authentication for TypeScript apps on Cloudflare Workers with D1.

54|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/dennislee928/Ethic-Latex --skill better-auth-dennislee928
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/dennislee928/Ethic-Latex/tree/main/.claude/skills/better-auth
Command: npx skills add https://github.com/dennislee928/Ethic-Latex --skill better-auth-dennislee928

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a robust, self-hosted authentication solution for TypeScript applications, particularly those using Cloudflare Workers and D1 databases, offering a powerful alternative to managed services like Clerk or Auth.js.

Core Features & Use Cases

  • Cloudflare D1 Integration: Seamless authentication with Cloudflare Workers and D1, using Drizzle ORM or Kysely.
  • Comprehensive Features: Supports social logins, 2FA, passkeys, multi-tenancy with organizations, RBAC, and more via extensive plugins.
  • Use Case: You're building a SaaS application on Cloudflare Workers and need a secure, scalable, and cost-effective authentication system that you control entirely, avoiding vendor lock-in and high subscription fees.

Quick Start

Use the better-auth skill to set up email and password authentication for your Cloudflare Worker project.

Frequently Asked Questions about better-auth

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up self-hosted authentication for a Cloudflare Workers application?

To set up self-hosted authentication for Cloudflare Workers, you can use this framework to implement email and password logins alongside a D1 database, utilizing Drizzle ORM or Kysely for data management.

Does this authentication framework support multi-tenancy and role-based access control?

Yes, the authentication framework supports multi-tenancy through organizational management plugins and includes role-based access control, allowing you to secure SaaS applications with granular permissions.

Can I use social logins and two-factor authentication with a self-hosted TypeScript auth solution?

Yes, this self-hosted TypeScript authentication solution provides extensive plugins that enable social logins, two-factor authentication, and passkeys to secure user accounts without managed service dependencies.

What is the best way to avoid vendor lock-in for authentication when building a SaaS application on Cloudflare D1?

The best way to avoid vendor lock-in on Cloudflare D1 is implementing a self-hosted authentication framework, which provides comprehensive features like 2FA and RBAC while avoiding high subscription fees from managed services.

How do I integrate Drizzle ORM with a D1 database for authentication in TypeScript?

You can integrate Drizzle ORM with a D1 database for TypeScript authentication by using this self-hosted framework, which offers seamless integration to manage users and sessions directly within your Cloudflare Workers environment.