bobmatnyc avatar

Better Auth Plugins

This walks Claude through Better Auth's plugin system for adding authentication features like 2FA, magic links, passkeys, and organizations to TypeScript apps. You'll use it when you need to extend basic auth with server-side plugins and their matching client-side counterparts. The skill covers the standard flow: import from better-auth/plugins, add to your config, run migrations if the plugin touches the database, then wire up the client plugin. The main gotcha is keeping server and client plugins paired so your APIs stay in sync, and remembering that nextCookies needs to go last if you're using it. Solid reference material for the plugin ecosystem without having to context-switch to docs.

skills.sh installs
362
GitHub stars
79
last updated
Aug 21, 2026

Install

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

Installs into .claude/skills of the current project.

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.

Sponsors

Details

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

More from bobmatnyc/claude-mpm-skills

All 158
1davila7 avatarbiorxiv-databasedavila7/claude-code-templatesEfficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or cate358skills.sh installs
2secondsky avatarbun-drizzle-integrationsecondsky/claude-skillsUse when integrating Drizzle ORM with Bun's SQLite driver for type-safe schema definitions and migrations.353skills.sh installs
3jezweb avataremail-gatewayjezweb/claude-skillsMulti-provider email sending for Cloudflare Workers and Node.js applications. Build transactional email systems with Resend (React Email support), SendGrid (ent342skills.sh installs
4bobmatnyc avatargraphqlbobmatnyc/claude-mpm-skillsGraphQL query language and runtime for APIs enabling clients to request exactly the data they need with strongly-typed schemas and single endpoint architecture.340skills.sh installs
5secondsky avatarbun-http-serversecondsky/claude-skillsUse when building HTTP servers with Bun.serve, handling requests/responses, implementing routing, creating REST APIs, or configuring fetch handlers.336skills.sh installs
6jezweb avatarazure-authjezweb/claude-skillsMicrosoft Entra ID (Azure AD) authentication for React SPAs with MSAL.js and Cloudflare Workers JWT validation using jose library. Full-stack pattern with Autho327skills.sh installs