better-auth-best-practices

Configure Better Auth in TypeScript projects with secure defaults and migration-ready steps.

27|11|Updated Mar 18, 2022
One-click install
npx skills add https://github.com/dkast/biztro --skill better-auth-best-practices-dkast
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: better-auth-best-practices
Source: https://github.com/dkast/biztro/tree/main/.github/skills/better-auth-best-practices
Command: npx skills add https://github.com/dkast/biztro --skill better-auth-best-practices-dkast

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides practical guidance and code patterns for integrating Better Auth into a TypeScript project, reducing setup confusion and ensuring robust authentication flows.

Core Features & Use Cases

  • Configured authentication: Set up email/password, OAuth, and social providers with sensible defaults.
  • Secure session management: Follow best practices for session storage and cookies.
  • Migration-ready guidance: Align Prisma/ORM models with Better Auth adapters for maintainability.

Quick Start

Configure Better Auth by setting BETTER_AUTH_SECRET and BETTER_AUTH_URL, then wire adapters and plugins in your TS project.

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 in a TypeScript project for secure authentication?

To configure Better Auth, set the BETTER_AUTH_SECRET and BETTER_AUTH_URL environment variables, then wire your database adapters and plugins directly in your TypeScript project to enable secure authentication flows with sensible defaults.

What is the best way to manage sessions in Better Auth?

The best way to manage sessions in Better Auth is to follow the provided best practices for secure session storage and cookies, ensuring robust authentication flows and protecting user session data across requests.

Can I use Prisma as a database adapter with Better Auth?

Yes, you can use Prisma with Better Auth. The Skill provides migration-ready guidance to align your Prisma ORM models with Better Auth database adapters, ensuring your database schema remains maintainable and correctly structured.

How do I set up OAuth and social providers in Better Auth?

You can set up OAuth and social providers in Better Auth by applying the provided best-practice integration patterns, which establish configured authentication with sensible default settings for secure social login workflows.

What are common pitfalls when integrating Better Auth?

Common pitfalls when integrating Better Auth include misconfiguring environment variables, neglecting secure defaults, and poorly aligning ORM models with adapters, all of which this Skill addresses through clear configuration guidelines and migration-ready steps.