better-auth-best-practices

Configure Better Auth authentication in TypeScript web applications.

1|Updated Feb 19, 2025
One-click install
npx skills add https://github.com/trystan2k/favoritable-old --skill better-auth-best-practices-trystan2k
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/trystan2k/favoritable-old/tree/main/.agents/skills/better-auth-best-practices
Command: npx skills add https://github.com/trystan2k/favoritable-old --skill better-auth-best-practices-trystan2k

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the guesswork and frequent configuration errors when integrating Better Auth into TypeScript applications, saving developers hours of debugging authentication setup issues.

Core Features & Use Cases

  • End-to-End Setup Guidance: Step-by-step instructions for installing Better Auth, configuring environment variables, setting up database adapters for Drizzle ORM, Prisma, and other supported databases, and creating route handlers for common web frameworks.
  • Plugin & Security Configuration: Guidance for adding popular plugins like two-factor authentication, passkeys, and OAuth providers, plus security best practices for session management, CSRF protection, rate limiting, and cookie configuration.
  • Use Case: For example, use this Skill to quickly set up a full authentication system for a React + Fastify app with GitHub OAuth, email/password login, and 2FA support, avoiding common implementation pitfalls like misconfigured model names or session storage errors.

Quick Start

Use the better-auth-best-practices skill to set up a fully configured Better Auth instance with email/password login and GitHub OAuth for your TypeScript web application.

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 ORM or Prisma in a TypeScript app?

Configuring Better Auth with Drizzle ORM or Prisma requires setting up environment variables, initializing the database adapter, and creating route handlers for your web framework. This establishes a secure authentication foundation with proper session management.

What is the best way to add OAuth providers and two-factor authentication to Better Auth?

The best way to add OAuth providers and two-factor authentication to Better Auth is through its plugin system. You can integrate plugins for passkeys, 2FA, and OAuth providers like GitHub to enhance web security without misconfiguring model names.

How does session management work in Better Auth for production web applications?

Session management in Better Auth for production web applications works by utilizing secure cookie configurations and CSRF protection. Following official best practices prevents common session storage errors and security vulnerabilities in your TypeScript backend.

Can I use Better Auth with Fastify and React for full-stack TypeScript authentication?

Yes, you can use Better Auth with Fastify and React for full-stack TypeScript authentication. It provides step-by-step guidance for creating route handlers and avoiding implementation pitfalls like misconfigured model names or session storage errors.

Why does my Better Auth setup fail with misconfigured model names or session storage errors?

Your Better Auth setup fails with misconfigured model names or session storage errors due to common configuration friction during integration. Adhering to official best practices for database adapters and plugin configuration eliminates these setup issues.