better-auth-best-practices

Integrate Better Auth TypeScript authentication with database adapters and session management.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill simplifies the complex configuration and integration of the Better Auth framework, ensuring developers follow security best practices and avoid common implementation pitfalls.

Core Features & Use Cases

  • Configuration Guidance: Provides clear instructions on setting up environment variables, database adapters, and session management strategies.
  • Security Hardening: Offers expert advice on cookie security, CSRF protection, and rate limiting to keep authentication flows robust.
  • Use Case: When setting up a new project, use this Skill to verify your database adapter model mappings and ensure your session storage strategy is correctly optimized for your specific infrastructure.

Quick Start

Use the better-auth-best-practices skill to generate the necessary database schema migration commands for my current 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 database adapters and session management in Better Auth?

To configure Better Auth database adapters and session management, you must map your database schema models and select a session storage strategy optimized for your specific infrastructure. This ensures correct user authentication data persistence and secure session handling.

What security protocols are needed for Better Auth email and OAuth flows?

Securing Better Auth email and OAuth flows requires implementing robust cookie security, CSRF protection, and rate limiting. These security protocols harden authentication endpoints against common web vulnerabilities and unauthorized access attempts.

How do I generate database schema migration commands for a Better Auth project?

Generating database schema migration commands for Better Auth involves using the framework's configuration to define your model mappings. This produces the necessary database migrations to store user credentials, sessions, and OAuth account links.

Does Better Auth support passkey authentication alongside email and OAuth?

Yes, Better Auth supports passkey authentication alongside standard email and OAuth flows. Implementing passkeys requires configuring the specific framework plugins to handle WebAuthn credentials and ensure adherence to framework-specific security standards.

What are the best practices for session storage strategy in TypeScript authentication?

Best practices for TypeScript authentication session storage involve optimizing your strategy based on your specific infrastructure and database adapter. Proper configuration prevents session hijacking and ensures efficient user session validation across your web application.

Why am I encountering common implementation pitfalls when setting up Better Auth?

Common implementation pitfalls in Better Auth usually stem from incorrect environment variable setup or misconfigured database adapter model mappings. Following framework-specific standards for plugin implementation and security hardening prevents these configuration errors.