better-auth-best-practices

Configure Better Auth securely in TypeScript projects with adapters and plugins.

Updated Jan 2, 2026
One-click install
npx skills add https://github.com/nickstrad/nick-stack-1 --skill better-auth-best-practices-nickstrad
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/nickstrad/nick-stack-1/tree/main/.agents/skills/better-auth-best-practices
Command: npx skills add https://github.com/nickstrad/nick-stack-1 --skill better-auth-best-practices-nickstrad

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides best-practice guidance for integrating Better Auth within TypeScript projects, focusing on secure configuration, plugin usage, and reliable session handling.

Core Features & Use Cases

  • Best-practice configuration patterns for appName, baseURL, secret, adapters, and storage options.
  • Plugin usage examples, including two-factor authentication and OAuth providers, plus security considerations.
  • Use Case: When building a web app or API, follow these guidelines to implement reliable authentication with Better Auth.

Quick Start

Install the Better Auth library in a TypeScript project, define a minimal configuration via environment variables, and run the migration CLI to initialize the schema. npx @better-auth/cli@latest migrate npx @better-auth/cli@latest generate

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 securely in a TypeScript project?

To configure Better Auth securely, define appName, baseURL, secret, adapters, and storage options using environment variables to ensure reliable session handling across your TypeScript web apps and APIs.

What's the best way to set up two-factor authentication and OAuth providers with Better Auth?

The best way to set up two-factor authentication and OAuth providers in Better Auth is by using its plugin system, applying the recommended usage examples and security considerations to protect user sessions.

How do I initialize the database schema for Better Auth?

To initialize the database schema for Better Auth, run the migration CLI command `npx @better-auth/cli@latest migrate` after installing the library and defining your minimal configuration.

What are common pitfalls when integrating Better Auth across web apps and APIs?

Common pitfalls when integrating Better Auth across web apps and APIs involve misconfiguring adapters and session management, which you can avoid by following best-practice configuration patterns and reliable session handling guidelines.

Does Better Auth work for both web apps and backend API services?

Yes, Better Auth works for both web apps and backend API services, providing best-practice configuration patterns, adapter usage examples, and secure session handling tailored for TypeScript projects across these environments.

Related Skills