better-auth-best-practices

Configure Better Auth server and client with database adapters and plugins.

Updated Jan 4, 2024
One-click install
npx skills add https://github.com/zeis974/TaxDOM --skill better-auth-best-practices-zeis974
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/zeis974/TaxDOM/tree/main/apps/dashboard/.agents/skills/better-auth-best-practices
Command: npx skills add https://github.com/zeis974/TaxDOM --skill better-auth-best-practices-zeis974

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

  • Configure Better Auth server and client with adapters, session management, and plugins
  • Manage environment variables and migration workflows for secure authentication
  • Use cases include integrating email/password, OAuth, and plugin-based authentication across web apps

Quick Start

Create auth.ts with database config and run the migration to initialize the schema.

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 a database adapter in TypeScript?

To set up Better Auth, create an auth.ts file with your database configuration and run the migration command to initialize the schema. This configures the server and client for secure authentication across your web app.

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

Managing environment variables for Better Auth involves securely configuring baseURL, appName, and OAuth credentials. The system handles these environment variables to manage secure authentication workflows across server and client integrations.

Does Better Auth support session management and plugins for web apps?

Yes, Better Auth supports session management and plugins for web apps. You can configure core options like appName, baseURL, database adapters, storage, email flows, security, hooks, and plugins to extend authentication functionality.

How do I configure email and password authentication using Better Auth?

Configure email and password authentication in Better Auth by defining the email flows within your auth.ts setup. You must configure the server and client, set up database adapters, and run migrations to apply the schema.

Why do I need to run migrations after configuring my Better Auth server?

Running migrations after configuring your Better Auth server is required to apply the schema to your database. This initialization step ensures the database adapters and session management have the necessary tables for secure authentication.