Skip to content
AI Skills Central

Type to search Agent Skills, workflows, tutorials, tools and the glossary.

Agent Skill

Better Auth best practices

Configures Better Auth server and client: database adapters, sessions, email flows, plugins, hooks, environment variables and common gotchas.

name: better-auth-best-practicesBy Better AuthChecked
View source on GitHub
Bookmark

Bookmarks are kept in your free account, so you can find this page again on any device.

Sign in to bookmark

Install

Commands are pinned to commit 20c9e88, the version we read, wherever the install method supports it.

npx skills

Terminal
npx skills add better-auth/skills@20c9e88a5c007461a703f1c213572b073196113e --skill better-auth-best-practices -a claude-code

Copies the skill into .claude/skills/ in this project, pinned to the reviewed commit.

Plugin marketplace

Claude Code prompt
/plugin marketplace add better-auth/skills
/plugin install auth-skills@better-auth-agent-skills

Run inside Claude Code. Installs the whole auth-skills plugin from its default branch, not the pinned commit.

What it does

An integration guide from the Better Auth team. It starts with the documentation version it was written against, then gives a setup workflow, environment variables, file location and CLI commands, followed by sections on core config, database adapters, sessions, user and account config, email flows, security, hooks, plugins, the client and type safety. A common-gotchas section closes it.

When to use it

Setting up Better Auth in a TypeScript app, adding plugins such as two-factor or organisations, choosing a database adapter, or debugging sessions and cookies. The common-gotchas section covers the configuration mistakes that produce confusing login failures.

When to skip it

Other auth libraries, and projects on a much newer or older Better Auth version than the one the skill states. Check that version first, because auth configuration changes between releases.

Try it

Add Better Auth to this Next.js app with email and password plus
GitHub OAuth, using the Drizzle adapter with Postgres. Set up the
client, protect /dashboard and list the environment variables needed.

What it can touch

Bundles scripts
No
Pre-approved tools
See source
Needs
Nothing beyond the agent
Client-specific fields
None, spec fields only
Files
At commit 20c9e88 the SKILL.md is 193 lines long and it is the only file in the folder.

Its instructions steer what your agent does, and it may have changed since the commit we read. How to check a skill.

Instructions only. The name (better-auth-best-practices) does not match the folder (best-practices), so claude.ai uploads need the folder renamed. Check the documentation version it states against the version in your project.

Outline of the SKILL.md

We have not reproduced this SKILL.md because neither the skill nor the better-auth/skills repository declares a licence, so we have no permission to republish it. We checked again on 20 November 2026. These are its section headings at the reviewed commit; read the full file at the source link.

  • Documentation Version
  • Setup Workflow
  • Quick Reference
  • Core Config Options
  • Database
  • Session Management
  • User & Account Config
  • Email Flows
  • Security
  • Hooks
  • Plugins
  • Client
  • Type Safety
  • Common Gotchas
  • Resources

Alternatives

The same repository has a create-auth skill for new projects, which we have not reviewed. For the database side, see Prisma ORM setup or Neon Postgres, and run security review on the result.

SKILL.md

We have not reproduced this file here; the outline above lists its sections. Read the SKILL.md on GitHub.

  • Agents SDK (Cloudflare)

    Cloudflare's skill for building, debugging and reviewing agents on its Agents SDK: Agent classes, routing, state, scheduling, chat, MCP and the React client.

    Checked at 5108325

  • Durable Objects (Cloudflare)

    Cloudflare's skill to build, debug and review Durable Objects: when to use them, wrangler config, storage, alarms, stubs, authorisation and testing.

    Checked at 5108325

  • EAS Update (Expo)

    Expo's skill that sets up and publishes over-the-air updates with EAS CLI, and debugs installed builds that still show old code after an update ships.

    Checked at 88d9bd7

  • AI security

    Defending against prompt injection, data leakage and over-permissioned agents.

    SkillIntermediate