better-auth-best-practices
Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.
What it does
- Built-in adapter: npx @better-auth/cli@latest migrate
- Prisma: npx @better-auth/cli@latest generate --output prisma/schema.prisma then npx prisma migrate dev
- BETTERAUTHSECRET - Encryption secret (min 32 chars). Generate: openssl rand -base64 32
- BETTERAUTHURL - Base URL (e.g., https://example.com)
- npx @better-auth/cli@latest migrate - Apply schema (built-in adapter)
- npx @better-auth/cli@latest generate - Generate schema for Prisma/Drizzle
- npx @better-auth/cli mcp --cursor - Add MCP to AI tools
Requirements & configuration
- 7. Drizzle: db not initialized - drizzleAdapter(db, ...) requires a db instance from drizzle(). See create-auth skill for setup examples (node-postgres, postgres.js, Neon).
- 8. Drizzle: missing drizzle.config.ts - drizzle-kit commands require a drizzle.config.ts pointing to the generated schema file and DB credentials.
Configuration: BETTER_AUTH_SECRETBETTER_AUTH_URL
Derived from the skill's own SKILL.md documentation · extracted 2026-07-23
Complete Better Auth server and client setup with database adapters, session management, plugins, and security configuration.
Source
Repository: https://github.com/better-auth/skills
better-auth-best-practices FAQ
What does the better-auth-best-practices skill do?
Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables. Use when users mention Better Auth, betterauth, auth.ts, or need to set up TypeScript authentication with email/password, OAuth, or plugin configuration. Built-in adapter: npx @better-auth/cli@latest migrate Prisma: npx @better-auth/cli@latest generate --output prisma/schema.prisma then npx prisma migrate dev
What does better-auth-best-practices require?
7. Drizzle: db not initialized - drizzleAdapter(db, ...) requires a db instance from drizzle(). See create-auth skill for setup examples (node-postgres, postgres.js, Neon). 8. Drizzle: missing drizzle.config.ts - drizzle-kit commands require a drizzle.config.ts pointing to the generated schema file and DB credentials. Configuration keys: BETTER_AUTH_SECRET, BETTER_AUTH_URL.
How do I install better-auth-best-practices?
Run: npx -y skills add https://github.com/better-auth/skills --skill better-auth-best-practices --agent claude-code — the source lives at github.com/better-auth/skills.
Maintain better-auth-best-practices?
Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.
[](https://getagentictools.com/skills/better-auth-skills-better-auth-best-practices?ref=badge) npx agentictools info skills/better-auth-skills-better-auth-best-practices The second line is the CLI lookup for this page — handy in READMEs and docs.