better-auth-best-practices

Configure Better Auth for TypeScript apps with adapters, plugins, and security options.

1|1|Updated Feb 7, 2026
One-click install
npx skills add https://github.com/mauricioacp/tanstack-convex-better-auth-template --skill better-auth-best-practices-mauricioacp
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/mauricioacp/tanstack-convex-better-auth-template/tree/main/.agents/skills/better-auth-best-practices
Command: npx skills add https://github.com/mauricioacp/tanstack-convex-better-auth-template --skill better-auth-best-practices-mauricioacp

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Better Auth best practices help teams implement secure, scalable authentication in TypeScript projects using the Better Auth framework.

Core Features & Use Cases

  • Comprehensive configuration patterns for baseURL, secret, adapters, and plugins.
  • Secure session handling, multi-factor options, and plugin-driven customization for common auth flows.
  • Use Case: You are migrating a legacy auth system to Better Auth with minimal downtime and strong security.

Quick Start

Install the Better Auth CLI, configure your project, and apply the recommended best practices to ensure secure, scalable authentication.

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 for secure session management in TypeScript?

Secure session management in Better Auth involves configuring a robust secret, secure cookie options, and CSRF protection. It supports multi-factor authentication and plugin-driven customization for scalable user management.

What's the best way to set up Better Auth with Prisma or Drizzle adapters?

Setting up Better Auth with Prisma or Drizzle uses dedicated database adapters to handle user and session storage. You configure the adapter in your auth instance to ensure scalable authentication data persistence in TypeScript.

Does Better Auth support OAuth and passkeys for multi-method authentication?

Better Auth supports multiple authentication methods including OAuth, magic links, and passkeys. These methods are implemented through its plugin-driven architecture to provide flexible and secure login options.

How do I use the Better Auth CLI commands for database migration?

The Better Auth CLI provides migrate, generate, and mcp commands to manage your database schema. Running these commands applies the required tables for user management and plugin configurations.

Can I migrate a legacy auth system to Better Auth with minimal downtime?

Migrating a legacy auth system to Better Auth is supported by applying comprehensive configuration patterns and database adapters. This ensures a smooth transition with strong security options like CSRF and secure cookies.