Skip to content

better-auth-security-best-practices

Configure rate limiting, manage auth secrets, set up CSRF protection, define trusted origins, secure sessions and cookies, encrypt OAuth tokens, track IP

— (0 ratings) 53.2K downloads better-auth
$ npx skills add https://github.com/better-auth/skills --skill better-auth-security-best-practices

Skills can run code on your computer. Review the source before installing. This listing is community-made and isn't affiliated with Anthropic.

About this skill

Secret Management

Configuring the Secret

import { betterAuth } from "better-auth";

export const auth = betterAuth({
  secret: process.env.BETTER_AUTH_SECRET, // or via `BETTER_AUTH_SECRET` env
});

Better Auth looks for secrets in this order:

  1. options.secret in your config
  2. BETTER_AUTH_SECRET environment variable
  3. AUTH_SECRET environment variable

Secret Requirements


Installs: 53.2K | GitHub stars: 232 | First seen: Feb 11, 2026

Related skills

New

DevOps & cloud

azure-compliance

Azure compliance scanning, Key Vault expiration auditing, and resource configuration validation.

New • 779.8K
New

Security

entra-app-registration

Microsoft Entra ID app registration, OAuth 2.0 configuration, and MSAL integration for secure application authentication.

New • 779.4K
New

Agent workflows

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces,

New • 662.2K