better-auth-best-practices

Installation
Summary

Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.

  • Covers full workflow from installation through database migration, environment variable setup, and route handler creation across multiple frameworks
  • Supports multiple database adapters (Prisma, Drizzle, MongoDB, direct connections) with critical guidance on model vs. table naming conventions
  • Includes session storage strategies with secondary storage (Redis/KV), cookie caching modes (compact, JWT, JWE), and stateless operation options
  • Provides 10+ popular plugins (two-factor, organization, passkey, magic link, OAuth provider, SSO) with tree-shaking imports and client-side integration
  • Features before/after hooks at endpoint and database levels, rate limiting configuration, CSRF/origin security controls, and type-safe client methods across vanilla, React, Vue, Svelte, and Solid frameworks
SKILL.md

Better Auth Integration Guide

Documentation Version

Use documentation that matches the Better Auth version installed in the project. APIs and plugin names can differ across maintained release lines.

  1. Prefer a version explicitly named by the user.
  2. Otherwise, inspect the resolved better-auth version in the lockfile, falling back to the package manifest when no lockfile is available.
  3. When the Better Auth MCP is available, call get_doc with /llms.txt to resolve that package version to a documentation identifier. Pass the identifier to every search_docs call and pass result paths to get_doc unchanged.
  4. Without MCP, start at better-auth.com/llms.txt and follow the matching version index.
  5. Use the latest documentation only when the project version cannot be determined or the user explicitly asks about the latest release or an upgrade.

When planning an upgrade, separate guidance for the currently installed version from guidance for the target version.


Setup Workflow

Installs
104.9K
GitHub Stars
212
First Seen
Jan 19, 2026
better-auth-best-practices — better-auth/skills