import createClient from "openapi-fetch"; import type { paths } from "./schema"; // Same-origin in production (Caddy proxies /api/* to the backend). Override with // NEXT_PUBLIC_API_BASE_URL for split local dev. credentials:"include" sends the // HttpOnly session cookie the backend issues on login. const baseUrl = process.env.NEXT_PUBLIC_API_BASE_URL ?? ""; export const api = createClient({ baseUrl, credentials: "include" });