
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.
$ npx -y skills add bobmatnyc/claude-mpm-skills --skill better-auth-plugins --agent claude-codeInstalls into .claude/skills of the current project.
better-auth/plugins and add it to plugins.generate or migrate) when required.better-auth/client/plugins.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" })],
});
Run the CLI when a plugin adds tables:
npx @better-auth/cli generate
npx @better-auth/cli migrate
nextCookies (if used) last in the server plugin list.Sponsors