better-auth

Configure self-hosted authentication for TypeScript apps with Drizzle ORM or Kysely adapters.

2|Updated Feb 8, 2026
One-click install
npx skills add https://github.com/ByteSliceHQ/formflip --skill better-auth-byteslicehq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth
Source: https://github.com/ByteSliceHQ/formflip/tree/main/.agents/skills/better-auth
Command: npx skills add https://github.com/ByteSliceHQ/formflip --skill better-auth-byteslicehq

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-hostable authentication solution for TypeScript applications, offering a powerful alternative to cloud-based services like Clerk or Auth.js. It handles complex authentication flows, multi-tenancy, and integrates with various databases and frameworks.

Core Features & Use Cases

  • Comprehensive Auth Features: Supports email/password, social logins (Google, GitHub, etc.), 2FA, passkeys, organizations, and Role-Based Access Control (RBAC).
  • Database Flexibility: Integrates with Drizzle ORM or Kysely for Cloudflare D1, or standard SQL databases like PostgreSQL.
  • Plugin Architecture: Extensible with numerous plugins for features like Stripe integration, SCIM provisioning, and more.
  • Use Case: Building a multi-tenant SaaS application where you need full control over user data and authentication logic, or integrating advanced auth features into an existing TypeScript project.

Quick Start

Use the better-auth skill to set up email and password authentication with a Drizzle ORM adapter for D1.

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 in a TypeScript SaaS application?

Self-hosted authentication in a TypeScript SaaS application is established by configuring the framework with a database adapter like Drizzle or Kysely, enabling email/password, social logins, and RBAC for multi-tenant control.

Can I use self-hosted auth with Cloudflare D1 and Drizzle ORM?

Yes, self-hosted auth works with Cloudflare D1 and Drizzle ORM by utilizing specific database adapters. This integration allows you to manage user identities and authentication logic directly on Cloudflare's edge network.

Does this TypeScript authentication framework support passkeys and 2FA?

This TypeScript authentication framework supports both passkeys and 2FA natively. These features integrate alongside social logins and organizations to provide comprehensive, self-hosted security for your application.

What is the best way to add Stripe billing and SCIM provisioning to custom auth?

The best way to add Stripe billing and SCIM provisioning to custom auth is through the framework's plugin architecture. This extensible system allows you to integrate advanced SaaS features directly into your authentication workflow.

How does self-hosted auth compare to cloud-based services like Clerk for multi-tenant apps?

Self-hosted auth provides full control over user data and authentication logic for multi-tenant apps, unlike cloud-based services like Clerk. It integrates directly with your SQL database using Drizzle or Kysely for custom implementations.

Do I need a specific database to implement RBAC and organizations in TypeScript?

You need a SQL database like PostgreSQL or Cloudflare D1 to implement RBAC and organizations in TypeScript. The framework connects to these databases using Drizzle ORM or Kysely adapters to manage complex multi-tenant roles.