What problem does it solve?
Provides a consolidated security configuration and operational checklist to protect Better Auth deployments from brute force attacks, credential leakage, CSRF exploits, session theft, and insufficient auditability.
Core Features & Use Cases
- Configures and enforces strong secret management, rate limiting with customizable storage and per-endpoint rules, and multi-layer CSRF protection.
- Secures sessions and cookies with strategies (compact, JWT, JWE), cross-subdomain options, and secure cookie attributes; adds OAuth protections such as PKCE, state handling, and optional token encryption.
- Enables IP tracking, trusted origin validation, background task handling for serverless platforms, and database hook-based audit logging for compliance and incident investigation.
- Use Case: Lock down a production API that handles sign-in, sign-up, password changes, and third-party OAuth by applying per-endpoint rate limits, enforcing trusted origins, encrypting tokens, and logging security-relevant events.
Quick Start
Configure Better Auth with a strong 32+ character secret, enable rate limiting and CSRF protection, set your trusted origins, and turn on audit hooks for session and account events.