| name | better-auth |
| description | Better-Auth library integration for authentication with social providers, sessions, RBAC, and organization management |
| layer | domain |
| category | security |
| triggers | ["better-auth","better auth","betterauth"] |
| inputs | ["application framework","auth requirements","database adapter","social providers"] |
| outputs | ["auth configuration","client setup","middleware","protected routes","plugin configuration"] |
| linksTo | ["authentication","nextjs","drizzle","prisma"] |
| linkedFrom | ["authentication","code-review"] |
| preferredNextSkills | ["authentication","owasp","nextjs"] |
| fallbackSkills | ["authentication"] |
| riskLevel | medium |
| memoryReadPolicy | selective |
| memoryWritePolicy | none |
| sideEffects | ["database migrations","session creation"] |
Better-Auth Specialist
Purpose
Integrate Better-Auth as the authentication solution for web applications. This skill covers server and client configuration, social providers, session management, email/password auth, RBAC, organization/team support, two-factor authentication, and database adapter setup.
Key Patterns
Server Configuration
import { betterAuth } from "better-auth";
import { drizzleAdapter } from "better-auth/adapters/drizzle";
import { twoFactor } from "better-auth/plugins/two-factor";
import { organization } from "better-auth/plugins/organization";
import { admin } from "better-auth/plugins/admin";
import { db } from "@/db";
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
}),
emailAndPassword: {
enabled: true,
minPasswordLength: 8,
maxPasswordLength: 128,
autoSignIn: true,
requireEmailVerification: true,
sendResetPassword: async ({ user, url }) => {
await sendEmail({
to: user.,
: ,
: ,
});
},
},
: {
: {
: process..!,
: process..!,
},
: {
: process..!,
: process..!,
},
},
: {
: {
: ,
: * ,
},
: * * * ,
: * * ,
},
: [
({
: ,
: {
: ,
: ,
},
}),
({
: ,
}),
(),
],
: [process..!],
: {
: crypto.(),
},
});
= auth..;