Research-mind toolchains-platforms-auth-better-auth-better-auth-plugins
Better Auth Plugins
install
source · Clone the upstream repo
git clone https://github.com/MacPhobos/research-mind
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/MacPhobos/research-mind "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/toolchains-platforms-auth-better-auth-better-auth-plugins" ~/.claude/skills/macphobos-research-mind-toolchains-platforms-auth-better-auth-better-auth-plugin && rm -rf "$T"
manifest:
.claude/skills/toolchains-platforms-auth-better-auth-better-auth-plugins/skill.mdsource content
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
- Import the plugin from
and add it tobetter-auth/plugins
.plugins - Run migrations (
orgenerate
) when required.migrate - 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
(if used) last in the server plugin list.nextCookies - Review plugin docs for required schema and env variables.
References
toolchains/platforms/auth/better-auth/better-auth-plugins/references/plugins-index.md