better-auth-best-practices

Configure Better Auth server and client with adapters, plugins, and environment variables.

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

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. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration.

Core Features & Use Cases

  • Setup Better Auth server and client in TypeScript projects.
  • Configure environment variables, adapters, and session management.
  • Extend authentication with plugins for OAuth, email/password, and plugin configuration.

Quick Start

Install better-auth, configure env vars, create auth.ts, run migrations, and verify the authentication API is responding.

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 set up Better Auth with email/password and OAuth in a TypeScript project?

Setting up Better Auth involves installing the package, configuring environment variables, creating an auth.ts file, and running migrations. This establishes both server and client authentication for email/password and OAuth.

What's the best way to manage environment variables for a Better Auth configuration?

The best way to manage Better Auth environment variables is to use an environment-variable driven configuration across both server and client. This approach securely handles secrets required for OAuth providers and session management.

How do database adapters and session management work in Better Auth?

Database adapters in Better Auth persist user data and manage sessions. You select an adapter, run migrations to create tables, and configure session handling across your server and client implementations.

Can I extend Better Auth with plugins for OAuth and email/password authentication?

Yes, Better Auth supports plugin integration to extend its core functionality. You can add plugins to enable OAuth providers and email/password authentication within your TypeScript application.

Does Better Auth require running database migrations after configuring the auth.ts file?

Yes, running database migrations is required after configuring your auth.ts file. Migrations generate the necessary database schema for your selected adapter to handle users, sessions, and OAuth accounts.