better-auth-best-practices

Configure Better Auth adapters, sessions, and CLI updates for TypeScript apps.

Updated Feb 24, 2026
One-click install
npx skills add https://github.com/FrekiManagarm/dunlo --skill better-auth-best-practices-frekimanagarm
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/FrekiManagarm/dunlo/tree/main/.agents/skills/better-auth-best-practices
Command: npx skills add https://github.com/FrekiManagarm/dunlo --skill better-auth-best-practices-frekimanagarm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill reduces authentication integration mistakes by turning Better Auth configuration and operational details into a clear, repeatable checklist.

Core Features & Use Cases

  • Environment-driven configuration: Use the correct BETTER_AUTH_SECRET and BETTER_AUTH_URL behavior to avoid conflicting settings.
  • Correct adapter and model mapping: Configure database adapters using ORM model names (not underlying table names) to prevent subtle runtime failures.
  • Robust session and security setup: Choose session storage priority, cookie cache strategy, and security options to match your deployment needs (stateless, DB-backed, or secondary storage).
  • Practical email and plugin workflows: Ensure email verification and password-reset flows are enabled and that CLI steps are re-run after plugin changes.

Quick Start

Ask the AI to generate a production-ready Better Auth auth.ts configuration using your adapter, session strategy, and required email/password setup, based on your environment variables.

Frequently Asked Questions about better-auth-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure Better Auth with Drizzle to prevent runtime failures?

To configure Better Auth with Drizzle safely, map database adapters using ORM model names rather than underlying table names. This prevents subtle runtime failures by ensuring the adapter correctly resolves schema mappings during authentication operations.

What's the best way to set up Better Auth sessions and cookie cache for stateless deployments?

The best way to set up Better Auth sessions is to define session storage priority and cookie cache strategy to match your deployment. Choose stateless, DB-backed, or secondary storage to optimize secure session performance for your specific architecture.

Why does my Better Auth email verification and password reset flow break after adding plugins?

Your Better Auth email verification flow breaks because CLI steps must be re-run after plugin changes. Executing these command-line interface schema updates guarantees required verification and password-reset workflows remain enabled and functional.

Do I need specific environment variables for secure Better Auth configuration?

Yes, you need the correct BETTER_AUTH_SECRET and BETTER_AUTH_URL environment variables for secure Better Auth configuration. Setting these properly avoids conflicting settings and ensures your TypeScript web app maintains secure sessions.

Can I use Prisma-style adapters with Better Auth for ORM-backed persistence?

Yes, you can use Prisma-style adapters with Better Auth for ORM-backed persistence. The setup guides correct adapter configuration to support secure sessions, email/password login, and optional social providers across supported ORMs.