Skip to content

DeliveryClientOptions

@ebitex/content-sdk — the framework-agnostic half.

  • Low-level: createDeliveryClient — one method per Content Delivery API endpoint, the delivered vocabulary as types (types.ts) and runtime guards (guards.ts), typed errors.
  • High-level: createContentClient — resolveLocation(location) for router changes: site from the page’s own host, locale from the browser’s languages against the organization’s tree, the context bag, a full/normalized resolve strategy, caching and cancellation.

Nothing here imports React; the rendering layer is @ebitex/content-sdk/react. Both clients run in a browser (with a browser-safe delivery key) and in Node (any key).

apiKey: string

A Content delivery key, created on the Content app’s Delivery page. A key with an allowed-origins or allowed-IP-ranges restriction is browser-safe and may ship in a bundle; a key with neither is a server-side key and must never reach a browser — it works from any origin and any address. The SDK cannot tell the two apart; only the Delivery page can, so decide where this client runs before choosing a key.


optional baseUrl?: string

Defaults to ebitex’s production API. Override for a self-hosted or local deployment.


optional fetch?: {(input, init?): Promise<Response>; (input, init?): Promise<Response>; }

Injectable for testing or for a runtime with a non-global fetch.

(input, init?): Promise<Response>

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>

(input, init?): Promise<Response>

MDN Reference

string | URL | Request

RequestInit

Promise<Response>


optional onAudienceStatus?: (status) => void

Called when a response carries X-Ebitex-Audiences-Status: expired | invalid: the audience token this client sent is no longer good, and the caller should obtain a fresh one. The high-level client wires this to its audience session; a direct user of this client may ignore it.

"expired" | "invalid"

void


optional onSandbox?: (mode) => void

Called when the mode the API reports for this organization changes: development or cutover while it is a sandbox an agency is building for a client, null once it is an ordinary organization (or if it never was). Read it off any response, so the first call after the organization goes live is the one that clears it.

SandboxMode | null

void