Skip to main content

Interface: CortexClientConfig

Properties

PropertyTypeDescriptionDefined in
accessToken?stringJWT bearer token for authentication4Players/cortex-typescript-sdk/src/client.ts:34
apiKey?stringAPI key for authentication (prefix: ots_live_)4Players/cortex-typescript-sdk/src/client.ts:32
baseUrlstringBase URL of the Cortex API (e.g. "https://cortex.odin.4players.io")4Players/cortex-typescript-sdk/src/client.ts:30
debug?booleanEnable debug logging — logs method, URL, status, and response body for every request4Players/cortex-typescript-sdk/src/client.ts:52
fetch?(input: RequestInfo | URL, init?: RequestInit) => Promise<Response>Custom fetch implementation4Players/cortex-typescript-sdk/src/client.ts:40
followRedirects?booleanFollow HTTP redirects manually, preserving the request method, body, and auth headers (including Authorization and HMAC signature headers) across origins. Defaults to true. The platform fetch strips Authorization on cross-origin redirects and downgrades POST→GET on 301/302, which breaks authenticated calls when the API host redirects (e.g. an ots.cortex. migration). Prefer pointing baseUrl at the final host; this is a safety net. Set to false to use the platform's native redirect handling.4Players/cortex-typescript-sdk/src/client.ts:50
projectId?stringProject ID (required for HMAC auth, will be used more broadly in future)4Players/cortex-typescript-sdk/src/client.ts:36
projectSecret?stringProject secret for HMAC-SHA256 authentication (used by ODIN platform services)4Players/cortex-typescript-sdk/src/client.ts:38
realtime?objectReal-time (SSE) tuning for watch() subscriptions4Players/cortex-typescript-sdk/src/client.ts:54
realtime.idleTimeoutMs?numberIdle/stall timeout in milliseconds for event streams. If no bytes (events or heartbeats) arrive within this window, the connection is reconnected and resynced — a defense against half-open sockets. The backend sends a heartbeat every ~15s. Defaults to 45000 (3 missed heartbeats). Set to 0 to disable.4Players/cortex-typescript-sdk/src/client.ts:62