better-auth-core
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.
What this skill does
# Better Auth Core (TypeScript)
## Goals
- Set up a Better Auth instance with environment variables and data layer wiring.
- Wire server handlers and a client instance.
- Use sessions and server-side API methods safely.
- Keep data-layer choices pluggable (drivers or adapters).
## Quick start
1. Install `better-auth`.
2. Set `BETTER_AUTH_SECRET` (32+ chars) and `BETTER_AUTH_URL`.
3. Create `auth.ts` and export `auth`.
4. Provide `database` (driver or adapter) or omit for stateless sessions.
5. Mount a handler (`auth.handler` or a framework helper).
6. Create a client with `createAuthClient`.
```ts
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,
},
},
});
```
## Core setup checklist
- Export the instance as `auth` (or default export) so helpers find it.
- Keep `BETTER_AUTH_URL` in sync with the public base URL.
- Pass the full base URL to the client if you change the `/api/auth` base path.
- Add database migrations before enabling plugins that require tables.
## Server API usage
- Call server endpoints via `auth.api.*` with `{ body, headers, query }`.
- Use `asResponse: true` if you need a `Response` object.
- Use `returnHeaders: true` to access `Set-Cookie` headers.
```ts
import { auth } from "./auth";
const session = await auth.api.getSession({
headers: request.headers,
});
const response = await auth.api.signInEmail({
body: { email, password },
asResponse: true,
});
```
## Session access
- Client: `authClient.useSession()` or `authClient.getSession()`.
- Server: `auth.api.getSession({ headers })`.
## TypeScript tips
- Infer types with `auth.$Infer` and `authClient.$Infer`.
- Use `inferAdditionalFields` on the client when you extend the user schema.
## References
- `toolchains/platforms/auth/better-auth/better-auth-core/references/setup-database.md`
- `toolchains/platforms/auth/better-auth/better-auth-core/references/client-server.md`
- `toolchains/platforms/auth/better-auth/better-auth-core/references/typescript.md`
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.