/** * Cross-cutting types used by the SDK. */ export type TorukClientConfig = { /** TORUK-CORE base URL (e.g. https://toruk.company.com). */ baseUrl: string; /** Authentication configuration. See src/types/auth.ts. */ auth: import('./auth').AuthConfig; /** * Default deployment for calls that don't name one (notably `sessions.*`). * Required unless every call passes its own `deploymentId`; the SDK throws a * configuration error rather than requesting `/deployments/undefined/...`. */ deploymentId?: string; /** Per-request timeout in milliseconds (default: 30_000). */ timeoutMs?: number; /** Extra headers merged into every outgoing request. */ headers?: Record; /** * Pre-request hook, awaited just before the request is sent. Receives the * fully-built RequestInit (auth and visitor headers already applied) and may * mutate it — the widget's `onRequest` extension point routes through here so * embedders have exactly one way to decorate outgoing requests. */ onRequest?: (request: RequestInit) => Promise | void; /** * Where the per-deployment `x-toruk-visitor` token is persisted. Defaults to * `window.localStorage` in browsers, memory elsewhere. Pass `null` to force * memory-only storage. */ visitorStorage?: import('../sessions/visitor-store').VisitorStorage | null; };