toolchains/platforms/auth/better-auth/better-auth-core/SKILL.md
Better Auth core setup for TypeScript apps. Use when configuring the Better Auth instance, wiring server handlers and client instances, working with sessions, or calling server-side auth APIs.
npx skillsauth add bobmatnyc/claude-mpm-skills better-auth-coreInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
better-auth.BETTER_AUTH_SECRET (32+ chars) and BETTER_AUTH_URL.auth.ts and export auth.database (driver or adapter) or omit for stateless sessions.auth.handler or a framework helper).createAuthClient.import { betterAuth } from "better-auth";
export const auth = betterAuth({
database: myDatabaseOrAdapter, // driver or adapter; omit for stateless mode
emailAndPassword: { enabled: true },
socialProviders: {
github: {
clientId: process.env.GITHUB_CLIENT_ID as string,
clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
},
},
});
auth (or default export) so helpers find it.BETTER_AUTH_URL in sync with the public base URL./api/auth base path.auth.api.* with { body, headers, query }.asResponse: true if you need a Response object.returnHeaders: true to access Set-Cookie headers.import { auth } from "./auth";
const session = await auth.api.getSession({
headers: request.headers,
});
const response = await auth.api.signInEmail({
body: { email, password },
asResponse: true,
});
authClient.useSession() or authClient.getSession().auth.api.getSession({ headers }).auth.$Infer and authClient.$Infer.inferAdditionalFields on the client when you extend the user schema.toolchains/platforms/auth/better-auth/better-auth-core/references/setup-database.mdtoolchains/platforms/auth/better-auth/better-auth-core/references/client-server.mdtoolchains/platforms/auth/better-auth/better-auth-core/references/typescript.mddevelopment
Axum (Rust) web framework patterns for production APIs: routers/extractors, state, middleware, error handling, tracing, graceful shutdown, and testing
development
Optimize web performance using Core Web Vitals, modern patterns (View Transitions, Speculation Rules), and framework-specific techniques
development
Best practices for documenting APIs and code interfaces, eliminating redundant documentation guidance per agent.
development
Comprehensive API design patterns covering REST, GraphQL, gRPC, versioning, authentication, and modern API best practices