/** * Boot-time fetcher for `GET /api/adaptive/mounted_elements`. * * Follows the SDK's vanilla-fetch convention (see * `packages/runtime-sdk/src/overlays/fetcher.ts` for the sibling pattern * — no shared HTTP client, no axios, no fetch wrapper). * * Auth: forwards the caller-supplied SDK token (from the runtime handle, * the single source `Syntro.init` populates — BUG-1785360157: never a * window global) as a Bearer header, plus the runtime's visitor ids * (`X-Distinct-Id` / `X-Syntro-Session`) so the backend rehydrates * mounts under the same session-keyed Redis state the chat persisted to. * * 404 contract: the backend returns 404 only when the workspace's SDK * token doesn't resolve to a workspace. The SDK treats 404 as * "feature unavailable" — no error UI, no retries — per the design doc. * Network errors are logged + swallowed so the SDK boot path stays * resilient to backend hiccups. */ import type { MountedElementsResponse } from './types'; export interface FetchMountedElementsOptions { /** Override the endpoint URL (defaults to same-origin * `/api/adaptive/mounted_elements`). Tests + multi-environment * deploys use this. */ endpoint?: string; /** SDK token from the runtime handle (`runtime.token`). Absent → * unauthenticated request; the backend 401s and the caller's null * contract kicks in. No window-global fallback (BUG-1785360157). */ token?: string; /** Custom fetch implementation — used by tests to mock the network. */ fetchImpl?: typeof fetch; /** Logger — used by tests to capture log output. */ logger?: Pick; } /** * Fetch the visitor's currently-mounted elements + session expiry. * * Returns `null` on any failure (404, network error, malformed JSON, * etc.). The caller treats `null` as "feature unavailable, no * rehydrate" — boot continues normally with an empty element store. */ export declare function fetchMountedElements(options?: FetchMountedElementsOptions): Promise; //# sourceMappingURL=fetcher.d.ts.map