better-auth-best-practices

Automate Better Auth integration for TypeScript server and client applications.

7|4|Updated Jun 7, 2025
One-click install
npx skills add https://github.com/lootlog/monorepo --skill better-auth-best-practices-lootlog
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/lootlog/monorepo/tree/main/.agents/skills/better-auth-best-practices
Command: npx skills add https://github.com/lootlog/monorepo --skill better-auth-best-practices-lootlog

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

Core Features & Use Cases

  • Centralized configuration for TypeScript authentication workflows with adapters and plugins
  • Comprehensive setup workflow covering environment variables, migrations, and session management
  • Use case: building a TS-based app that uses email/password authentication with OAuth providers and session handling

Quick Start

Install Better Auth, configure auth.ts with adapters and plugins, run migrations, and verify the API.

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 database adapters and plugins in TypeScript?

To configure Better Auth, you set up a centralized auth.ts file in TypeScript that defines your database adapters and plugins. This workflow covers environment variables, session management, and API verification to ensure secure authentication integration across server and client applications.

What's the best way to set up email and password authentication with OAuth providers in a TypeScript app?

Setting up email, password, and OAuth authentication in a TypeScript app involves configuring Better Auth with the appropriate plugins and database adapters. You apply best practices for environment setup and session management to handle multiple authentication providers within a single workflow.

How do I manage environment variables and run migrations for Better Auth?

Managing environment variables and migrations for Better Auth requires defining required variables like appName and baseURL. You use CLI commands provided by the workflow to generate schemas and run database migrations, ensuring your server and client authentication setup is synchronized.

Does Better Auth support centralized session management across server and client applications?

Yes, Better Auth supports centralized session management across both server and client TypeScript applications. The integration process applies specific configurations for session handling alongside database adapters and plugins to maintain secure authentication states throughout your application architecture.

Why do I need to specify appName and baseURL when integrating Better Auth?

Specifying appName and baseURL is required to satisfy Better Auth environment requirements and ensure proper routing. These variables anchor the authentication configuration, allowing the server and client to correctly generate schemas, manage sessions, and process OAuth callbacks securely.