$npx skillfedfor your agent

better-auth

better-auth is a production-ready authentication framework for TypeScript applications, supporting Next.js, Nuxt, Cloudflare Workers, and 15+ other frameworks. It handles email/password login, OAuth providers, two-factor authentication, passkeys, and role-based access control with built-in D1, PostgreSQL, MongoDB, and MySQL adapters. Deploy in minutes with a CLI, migrations, and pre-built plugins for organizations, SSO, and API keys.

better-auth is a TypeScript authentication framework that adds secure login, OAuth, and session management to web applications across 15+ frameworks.

AI-generated summary based on this skill's SKILL.md

196 29 MITupdated by secondsky

Decision gist · record as of 2026-07-25

better-auth is a TypeScript authentication framework that adds secure login, OAuth, and session management to web applications across 15+ frameworks. better-auth is a production-ready authentication framework for TypeScript applications, supporting Next.js, Nuxt, Cloudflare Workers, and 15+ other frameworks. It handles email/password login, OAuth providers, two-factor authentication, passkeys, and role-based access control with built-in D1, PostgreSQL, MongoDB, and MySQL adapters. Deploy in minutes with a CLI, migrations, and pre-built plugins for organizations, SSO, and API keys.

manual: git clone https://github.com/secondsky/claude-skills → cp -r claude-skills/plugins/better-auth/skills/better-auth ~/.claude/skills/better-auth
plugins/better-auth/skills/better-auth/SKILL.md · version e78d04ff

Use it when

  • better-auth makes adding authentication to a Next.js app straightforward.
  • Yes, better-auth includes a built-in D1 adapter for Cloudflare Workers environments.

Verify before relying

Read SKILL.md below before installing (38 files). Open directory: indexed for reading, not audited.

Same gist for agents: .md · .json

Install

secondsky/claude-skills/better-auth · repository language: TypeScript

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

What is better-auth and which frameworks does it support?

better-auth is a production-ready authentication framework for TypeScript applications. It supports Next.js, Nuxt, Cloudflare Workers, and 15+ other frameworks. The framework handles email/password login, OAuth providers, two-factor authentication, passkeys, and role-based access control with built-in adapters for D1, PostgreSQL, MongoDB, and MySQL. You can deploy in minutes using its CLI, migrations, and pre-built plugins for organizations, SSO, and API keys.

How do I add auth to a Next.js app with better-auth?

better-auth makes adding authentication to a Next.js app straightforward. The framework provides a CLI for quick setup, pre-configured adapters for your database, and built-in session management. You can choose email/password authentication, OAuth social login providers, or both. better-auth handles the server-side logic and client-side integration, allowing you to deploy authentication in minutes without complex configuration.

Can better-auth work with Cloudflare D1 database setup?

Yes, better-auth includes a built-in D1 adapter for Cloudflare Workers environments. The framework supports D1 database authentication alongside PostgreSQL, MongoDB, and MySQL. You can set up better-auth with D1 using the CLI and migrations, making it ideal for serverless deployments on Cloudflare's infrastructure.

What advanced authentication features does better-auth provide?

better-auth supports advanced features including two-factor authentication (2FA), passkeys with WebAuthn, multi-tenant organizations, role-based access control (RBAC), magic links, email verification, API key authentication, and SSO/SAML/OIDC setup. These features are available through pre-built plugins and can be integrated into your application to meet enterprise security requirements.

How do I implement OAuth and social login with better-auth?

better-auth provides built-in support for OAuth and social login providers. The framework simplifies provider configuration through its plugin system and CLI setup. You can enable multiple social login options alongside traditional email/password authentication, with better-auth handling token management, user creation, and session establishment automatically.

What should I do if I encounter a D1 adapter error in better-auth?

If you encounter a D1 adapter error in better-auth, verify that your D1 database is properly configured and migrations have run. Check that the D1 adapter is correctly imported and initialized in your authentication setup. Review the better-auth migration guide and ensure your Cloudflare Workers environment has the necessary D1 bindings configured. The framework's error messages typically indicate missing configuration or adapter initialization issues.

SKILL.md

Rendered from the published skill. Quoted content, verbatim.


name: better-auth description: 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. license: MIT metadata: keywords: "better-auth, authentication, cloudflare d1 auth, drizzle orm auth, kysely auth, self-hosted auth, typescript auth, clerk alternative, auth.js alternative, social login, oauth providers, session management, jwt tokens, 2fa, two-factor, passkeys, webauthn, multi-tenant auth, organizations, teams, rbac, role-based access, google auth, github auth, microsoft auth, apple auth, magic links, email password, better-auth setup, drizzle d1, kysely d1, session serialization error, cors auth, d1 adapter, nextjs auth, nuxt auth, remix auth, sveltekit auth, expo auth, react native auth, postgresql auth, mongodb auth, mysql auth, stripe auth, api keys, sso, saml, scim, admin dashboard, background tasks, oauth 2.1, cli, electron, i18n, instrumentation, otel, opentelemetry, test-utils, dynamic-base-url, secret-rotation, oauth-provider, mcp, passkey pre-auth, d1 native" version: "3.1.0"

(truncated - see the full file via the links below)

File tree — 15 files
plugins/better-auth/skills/better-auth/SKILL.md
plugins/better-auth/skills/better-auth/assets/auth-flow-diagram.md
plugins/better-auth/skills/better-auth/references/advanced-features.md
plugins/better-auth/skills/better-auth/references/cloudflare-worker-drizzle.ts
plugins/better-auth/skills/better-auth/references/cloudflare-worker-kysely.ts
plugins/better-auth/skills/better-auth/references/configuration-guide.md
plugins/better-auth/skills/better-auth/references/database-schema.ts
plugins/better-auth/skills/better-auth/references/databases/mongodb.md
plugins/better-auth/skills/better-auth/references/databases/mysql.md
plugins/better-auth/skills/better-auth/references/databases/postgresql.md
plugins/better-auth/skills/better-auth/references/error-catalog.md
plugins/better-auth/skills/better-auth/references/framework-comparison.md
plugins/better-auth/skills/better-auth/references/frameworks/api-frameworks.md
plugins/better-auth/skills/better-auth/references/frameworks/expo-mobile.md
plugins/better-auth/skills/better-auth/references/frameworks/nextjs.md

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Add authentication to a new or existing web application”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

scaffold-civitai-app
by civitai · civitai/civitai

This skill scaffolds a new application directory within the monorepo, automatically wiring only the @civitai/* packages your app requires. It handles dependency cherry-picking, Vite/Next transpile configuration, environment variable setup, and server-side shims for auth, database, Redis, and other integrations. Follow the interactive workflow to gather inputs, copy the base framework structure, apply per-package recipes, and verify the build.

Apache-2.0for claude-codeupdated Jul 2026
★ 7,201repo stars
tanstack-start
by jezweb · jezweb/claude-skills

TanStack Start scaffolds production-ready full-stack applications on Cloudflare Workers from scratch, with server-side rendering, file-based routing, and integrated authentication. Every file is generated fresh—no templates or clones—using React 19, Tailwind v4, shadcn/ui, D1 databases, Drizzle ORM, and better-auth for OAuth and email/password flows.

MITupdated Jul 2026
★ 943repo stars
nuxt-production
by secondsky · secondsky/claude-skills

Master Nuxt 4 production patterns for server-side rendering, from resolving hydration conflicts to deploying across major platforms. This skill covers performance optimization, Vitest testing strategies, and migration guidance from Nuxt 3, with practical solutions for common SSR pitfalls.

MITupdated Jul 2026
★ 196repo stars
dashboard-forge
by terrylica · terrylica/cc-skills

dashboard-forge handles vendor dashboard operations that have no public API by driving a real Chrome browser with persistent per-site profiles, letting humans handle logins once while scripts execute the rest reproducibly. It extracts secrets safely to vault, survives UI drift through step-and-shoot methodology, and covers tasks like minting scoped tokens and creating OAuth apps where the vendor offers no API or your existing token lacks scope.

MITupdated Jul 2026
★ 58repo stars
better-icons
by better-auth · better-auth/better-icons

Better Icons lets you search and fetch SVG icons from over 200 icon libraries through Iconify. Use the CLI to find icons by query, retrieve them by ID, or batch download results—with options to customize color and size. Also works as an MCP server for AI agents.

MITupdated Apr 2026
★ 1,205repo stars
cloudflare-zero-trust-access
by secondsky · secondsky/claude-skills

This skill provides production-ready patterns for adding Cloudflare Access authentication to Workers applications. It includes Hono middleware for one-line setup, manual JWT validation templates, service token support for backend auth, and solutions for common issues like CORS preflight blocking and missing headers.

MITupdated Jul 2026
★ 196repo stars

More skills cloudflare-turnstile (MIT) · cloudflare-workers-security (MIT) · cloudflare-r2 (MIT) · cloudflare-d1 (MIT)

Tags
auth-frameworktypescript-firstself-hosted-authmulti-providersession-basedoauth-integrationdatabase-agnosticenterprise-readydeveloper-friendlyedge-compatible