Skip to content
bobmatnyc avatar

Better Auth Plugins

Pairing server and client plugins for advanced Better Auth features like 2FA, passkeys, and JWT in TypeScript.

CCM score
49 of 100
skills.sh installs
380
GitHub stars
79
last updated
Aug 21, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers adding server plugins to plugins and matching client plugins from better-auth/client/plugins for TypeScript projects
  • Walks through a two-factor setup using twoFactor() on the server and twoFactorClient({ twoFactorPage }) on the client
  • Enforces matching server and client plugin registration and keeps nextCookies last in the server plugin list
  • Includes the generate and migrate CLI steps for plugins that add database tables, with a plugin index reference

Install

$ npx -y skills add bobmatnyc/claude-mpm-skills --skill better-auth-plugins -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Better Auth Plugins

Goals

  • Add server plugins to extend auth features.
  • Add client plugins for matching client methods.
  • Apply schema changes when plugins add tables.

Quick start

  1. Import the plugin from better-auth/plugins and add it to plugins.
  2. Run migrations (generate or migrate) when required.
  3. Add the client plugin from better-auth/client/plugins.

Example: Two-factor authentication

import { betterAuth } from "better-auth";
import { twoFactor } from "better-auth/plugins";

export const auth = betterAuth({
  plugins: [twoFactor()],
});
import { createAuthClient } from "better-auth/client";
import { twoFactorClient } from "better-auth/client/plugins";

export const authClient = createAuthClient({
  plugins: [twoFactorClient({ twoFactorPage: "/two-factor" })],
});

Migration reminder

Run the CLI when a plugin adds tables:

npx @better-auth/cli generate
npx @better-auth/cli migrate

Guardrails

  • Add server and client plugins together to keep APIs aligned.
  • Keep nextCookies (if used) last in the server plugin list.
  • Review plugin docs for required schema and env variables.

Details

Repository
github.com/bobmatnyc/claude-mpm-skills
Categories
Backend & APIs, Security
First seen
Jun 3, 2026

Questions

What does the better-auth-plugins skill do?

The better-auth-plugins skill gives an agent the Better Auth plugin system for TypeScript, covering advanced features such as two-factor authentication, magic link, passkey, username, JWT and organizations. It shows how to add each feature through a server plugin and a matching client plugin.

How do I install the better-auth-plugins skill?

Run npx -y skills add bobmatnyc/claude-mpm-skills --skill better-auth-plugins -y in your project to install it. Once installed, better-auth-plugins lets the agent add server and client plugins to a Better Auth setup and run the CLI migrations when a plugin adds tables.

What does better-auth-plugins need before I use it?

better-auth-plugins assumes a TypeScript project that uses Better Auth, since it imports plugins from better-auth/plugins and better-auth/client/plugins. Its guidance also says to review each plugin's docs for required schema and environment variables, and to run npx @better-auth/cli generate or migrate when a plugin adds tables.

Is better-auth-plugins for backend or API work?

better-auth-plugins sits in the Backend and APIs category on Claude Marketplaces. Its focus is adding advanced authentication features to a TypeScript auth setup, and it keeps server and client plugins aligned so the APIs match.

More from bobmatnyc/claude-mpm-skills

All 154

Similar to Better Auth Plugins

More Backend & APIs