better-auth

Solid

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 162 stars 25 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 88/100

Stars 20%
74
Recency 20%
90
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
6 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

API & Backend Solid

better-auth

Provides Better Auth integration patterns for NestJS backend and Next.js frontend with Drizzle ORM and PostgreSQL. Use when setting up Better Auth with NestJS backend, integrating Next.js App Router frontend, configuring Drizzle ORM schema, implementing social login (GitHub, Google), adding plugins (2FA, Organization, SSO, Magic Link, Passkey), implementing email/password authentication with session management, or creating protected routes and middleware.

263 Updated 1 weeks ago
giuseppe-trisciuoglio
API & Backend Listed

better-auth

Better Auth integration guide for TypeScript/JavaScript authentication. Covers server/client configuration, database adapters, session management, plugins, OAuth, and scaffolding auth from scratch. Use when setting up authentication with Better Auth, configuring auth.ts, adding OAuth providers, or creating sign-in/sign-up flows.

24 Updated 2 days ago
georgekhananaev
API & Backend Listed

060103-better-auth

Better Auth integration for Next.js — setup, API endpoints, client SDK, React Context provider, and Organization plugin for multi-tenant auth.

1 Updated yesterday
natuleadan
API & Backend Listed

better-auth-patterns

Auto-enforce Better Auth implementation patterns. Activates when setting up authentication, configuring providers, creating auth forms, or implementing session management in React applications.

3 Updated 1 weeks ago
smicolon
API & Backend Listed

better-auth-best-practices

Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration.

24 Updated 2 days ago
georgekhananaev