๐ŸŽฏ

better-auth-best-practices

๐ŸŽฏSkill

from better-auth/skills

VibeIndex|
What it does
|

A Claude Code skill that provides a comprehensive reference for integrating Better Auth, a TypeScript-first, framework-agnostic authentication framework supporting email/password, OAuth, magic links, passkeys, and extensible plugins.

Overview

better-auth-best-practices is a Claude Code skill from the official Better Auth team that serves as a comprehensive integration reference for Better Auth, a TypeScript-first, framework-agnostic authentication framework. The skill covers everything from initial configuration and database setup to session management, security hardening, and plugin integration. It guides Claude Code through environment variables, core config options, ORM adapter usage, endpoint/database hooks, and client-side SDK patterns, ensuring authentication is implemented correctly from the start.

Key Features

  • Complete configuration reference covering core options (appName, baseURL, database, socialProviders, plugins, trustedOrigins), session management strategies (secondaryStorage, cookie caching with compact/JWT/JWE modes), and advanced security settings (secure cookies, CSRF protection, rate limiting, cross-subdomain cookies).
  • Database and ORM adapter guidance for PostgreSQL, MySQL, SQLite, and MongoDB, with critical notes on model-name-vs-table-name pitfalls when using Prisma, Drizzle, or direct driver connections.
  • Plugin ecosystem reference listing popular plugins (twoFactor, organization, passkey, magicLink, emailOtp, admin, apiKey, bearer, SSO, and more) with proper tree-shaking import paths and client plugin configuration.
  • Hook system documentation for endpoint hooks (before/after with matchers) and database hooks (user/session/account create lifecycle), providing access to the full auth context including session, secret, adapter, and ID generation.
  • Client SDK patterns for React, Vue, Svelte, Solid, and vanilla JS, covering signUp, signIn, signOut, useSession, and type safety via auth.$Infer.Session.

Who is this for?

This skill is designed for developers adding authentication to TypeScript/JavaScript applications using Better Auth. It is especially useful for teams working with Next.js, SvelteKit, Nuxt, Express, Hono, or SolidStart who need a production-ready auth layer with support for multiple sign-in methods, plugin-based extensibility, and proper session/security configuration. Whether you are setting up a new project or migrating from another auth library, this skill ensures Claude Code follows current best practices and avoids common configuration mistakes.

๐Ÿ“ฆ

Same repository

better-auth/skills(10 items)

better-auth-best-practices

Installation

Vibe Index InstallInstalls to .claude/skills/ - auto-recognized by Claude Code
npx vibeindex add better-auth/skills --skill better-auth-best-practices
skills.sh Installโš  Installs to .agents/skills/ - may not be auto-recognized by Claude Code
npx skills add better-auth/skills --skill better-auth-best-practices
Manual InstallCopy SKILL.md content and save to the path below
~/.claude/skills/better-auth-best-practices/SKILL.md

SKILL.md

21,565Installs
92
-
Last UpdatedJan 17, 2026