better-auth
Build authentication systems for TypeScript/Cloudflare Workers with social auth, 2FA, passkeys, organizations, and RBAC.
Skill by ovachiever
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/ovachiever-better-auth
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: cloud, security
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Node.js package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/better-auth
What's inside
- Skill name
better-auth- Description
- Build authentication systems for TypeScript/Cloudflare Workers with social auth, 2FA, passkeys, organizations, and RBAC. Self-hosted alternative to Clerk/Auth.js. IMPORTANT: Requires Drizzle ORM or Kysely for D1 - no direct D1 adapter. v1.4.0 (Nov 2025) adds stateless sessions, ESM-only (breaking), JWT key rotation, SCIM provisioning. v1.3 adds SSO/SAML, multi-team support. Use when: self-hosting auth on Cloudflare D1, migrating from Clerk, implementing multi-tenant SaaS, or troubleshooting D1 adapter errors, session serialization, OAuth flows, TanStack Start cookie issues, nanostore session invalidation.
- License
- MIT
- Metadata
- github: https://github.com/better-auth/better-auth · version: 3.0.0 · last_verified: 2025-11-22 · official_docs: https://better-auth.com · token_savings: ~80% · package_version: 1.4.0 · breaking_changes: v1.4.0 - ESM-only (Nov 2025), v1.3 - Multi-team table changes (July 2025), v2.0.0 - D1 adapter patterns (Drizzle/Kysely required) · errors_prevented: 13 · production_tested: multiple (zpg6/better-auth-cloudflare, zwily/example-react-router-cloudflare-d1-drizzle-better-auth, foxlau/react-router-v7-better-auth, matthewlynch/better-auth-react-router-cloudflare-d1)
- Instructions
- 1,181 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Agent Skills spec issues
- allowed-tools: must be a space-separated string
- body: 1181 lines (spec recommends under 500)
Files (11)
- plugin.json · .claude-plugin/
- README.md
- SKILL.md
- auth-flow-diagram.md · assets/
- cloudflare-worker-drizzle.ts · references/
- cloudflare-worker-kysely.ts · references/
- database-schema.ts · references/
- README.md · references/nextjs/
- postgres-example.ts · references/nextjs/
- react-client-hooks.tsx · references/
- setup-d1-drizzle.sh · scripts/
SKILL.md (first lines)
# better-auth - D1 Adapter & Error Prevention Guide
**Package**: better-auth@1.4.0 (Nov 22, 2025)
**Breaking Changes**: ESM-only (v1.4.0), Multi-team table changes (v1.3), D1 requires Drizzle/Kysely (no direct adapter)
---
## ⚠️ CRITICAL: D1 Adapter Requirement
better-auth **DOES NOT** have `d1Adapter()`. You **MUST** use:
- **Drizzle ORM** (recommended): `drizzleAdapter(db, { provider: "sqlite" })`
- **Kysely**: `new Kysely({ dialect: new D1Dialect({ database: env.DB }) })`
See Issue #1 below for details.
---
## What's New in v1.4.0 (Nov 22, 2025)
**Major Features:**
- **Stateless session management** - Sessions without database storage
- **ESM-only package** ⚠️ Breaking: CommonJS no longer supported
- **JWT key rotation** - Automatic key rotation for enhanced security
- **SCIM provisioning** - Enterprise user provisioning protocol
- **@standard-schema/spec** - Replaces ZodType for validation
- **CaptchaFox integration** - Built-in CAPTCHA support
- Automatic server-side IP detection
- Cookie-based account data storage
- Multiple passkey origins support
- RP-Initiated Logout endpoint (OIDC)
📚 **Docs**: https://www.better-auth.com/changelogs
---
## What's New in v1.3 (July 2025)
**Major Features:**
- **SSO with SAML 2.0** - Enterprise single sign-on (moved to separate `@better-auth/sso` package)
- **Multi-team support** ⚠️ Breaking: `teamId` removed from member table, new `teamMembers` table required
- **Additional fields** - Custom fields for organization/member/invitation models
- Performance improvements and bug fixes
📚 **Docs**: https://www.better-auth.com/blog/1-3
---
## Alternative: Kysely Adapter Pattern
If you prefer Kysely over Drizzle:
**File**: `src/auth.ts`
```typescript
import { betterAuth } from "better-auth";
import { Kysely, CamelCasePlugin } from "kysely";
import { D1Dialect } from "kysely-d1";
type Env = {
DB: D1Database;
BETTER_AUTH_SECRET: string;
// ... other env vars
};
export function createAuth(env: Env) {
return betterAuth({
secret: env.BETTER_AUTH_SECRET,
// Kysely with D1Dialect
database: {
db: new Kysely({
dialect: new D1Dialect({
database: env.DB,
}),
plugins: [
// CRITICAL: Required if using Drizzle schema with snake_case
new CamelCasePlugin(),
],
}),
type: "sqlite",
},
emailAndPassword: {
enabled: true,
},
// ... other config
});
}
```
**Why CamelCasePlugin?**
If your Drizzle schema uses `snake_case` column names (e.g., `email_verified`), but better-auth expects `camelCase` (e.g., `emailVerified`), the `CamelCasePlugin` automatically converts between the two.
---
## Framework Integrations
### TanStack Start
**⚠️ CRITICAL**: TanStack Start requires the `reactStartCookies` plugin to handle cookie setting properly.
```typescript
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { reactStartCookies } from "better-auth/react-start";
export const auth = betterAuth({
database: drizzleAdapter(db, { provider: "sqlite" }),
plugins: [
twoFactor(),
organization(),
reactStartCookies(), // ⚠️ MUST be LAST plugin
],
});
```
**Why it's needed**: TanStack Start uses a special cookie handling system. Without this plugin, auth functions like `signInEmail()` and `signUpEmail()` won't set cookies properly, causing authentication to fail.From ovachiever/droid-tings, MIT.
More from ovachiever/droid-tings
- 0.514score
auto-animate
ovachiever
Zero-config animations for React, Vue, Solid, Svelte, Preact with @formkit/auto-animate (3.28kb).
SkillDFreshness: D★ 55Claude Code +9 - 0.514score
clerk-auth
ovachiever
Clerk auth with API version 2025-11-10 breaking changes (billing endpoints, payment_source→payment_method), Next.js v6 async auth(), PKCE for custom OAuth…
SkillDFreshness: D★ 55Claude Code +9 - 0.514score
ai-sdk-ui
ovachiever
Build React chat interfaces with Vercel AI SDK v5/v6.
SkillDFreshness: D★ 55Claude Code +9 - 0.514score
claude-api
ovachiever
Build with Claude Messages API using structured outputs (v0.69.0+, Nov 2025) for guaranteed JSON schema validation.
SkillDFreshness: D★ 55Claude Code +9 - 0.509score
capa-officer
ovachiever
Senior CAPA Officer specialist for managing Corrective and Preventive Actions within Quality Management Systems.
SkillDFreshness: D★ 55Claude Code +9 - 0.506score
bioservices
ovachiever
Primary Python tool for 40+ bioinformatics services.
SkillDFreshness: D★ 55Claude Code +9 - 0.506score
agile-product-owner
ovachiever
Agile product ownership toolkit for Senior Product Owner including INVEST-compliant user story generation, sprint planning, backlog management, and velocity…
SkillDFreshness: D★ 55Claude Code +9 - 0.506score
biopython
ovachiever
Primary Python toolkit for molecular biology.
SkillDFreshness: D★ 55Claude Code +9 - 0.506score
chembl-database
ovachiever
Query ChEMBL's bioactive molecules and drug discovery data.
SkillDFreshness: D★ 55Claude Code +9 - 0.505score
ai-sdk-core
ovachiever
Build backend AI with Vercel AI SDK v5/v6.
SkillDFreshness: D★ 55Claude Code +9 - 0.504score
api-documenter
ovachiever
Auto-generate API documentation from code and comments.
SkillDFreshness: D★ 55Claude Code +9 - 0.501score
claude-agent-sdk
ovachiever
Build autonomous AI agents with Claude Agent SDK.
SkillDFreshness: D★ 55Claude Code +9
Signals
- Stars
- 55
- Forks
- 5
- Open issues
- 1
- Last commit (this folder)
- Nov 24, 2025 (11 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 3.0.0
- License
- MIT
- Repository
- github.com/ovachiever/droid-tings
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
More from ovachiever
- 0.514score
claude-api
ovachiever
Build with Claude Messages API using structured outputs (v0.69.0+, Nov 2025) for guaranteed JSON schema validation.
SkillDFreshness: D★ 55Claude Code +9 - 0.514score
clerk-auth
ovachiever
Clerk auth with API version 2025-11-10 breaking changes (billing endpoints, payment_source→payment_method), Next.js v6 async auth(), PKCE for custom OAuth…
SkillDFreshness: D★ 55Claude Code +9 - 0.514score
ai-sdk-ui
ovachiever
Build React chat interfaces with Vercel AI SDK v5/v6.
SkillDFreshness: D★ 55Claude Code +9 - 0.514score
auto-animate
ovachiever
Zero-config animations for React, Vue, Solid, Svelte, Preact with @formkit/auto-animate (3.28kb).
SkillDFreshness: D★ 55Claude Code +9 - 0.509score
capa-officer
ovachiever
Senior CAPA Officer specialist for managing Corrective and Preventive Actions within Quality Management Systems.
SkillDFreshness: D★ 55Claude Code +9 - 0.506score
biopython
ovachiever
Primary Python toolkit for molecular biology.
SkillDFreshness: D★ 55Claude Code +9
Cite this page
better-auth skill. Agent Mart. https://agentmart.dev/skills/ovachiever-better-auth (last updated 2026-10-24)