ContentClientOptions
@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, afull/normalizedresolve 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).
Extends
Section titled “Extends”Properties
Section titled “Properties”apiKey
Section titled “apiKey”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.
Inherited from
Section titled “Inherited from”baseUrl?
Section titled “baseUrl?”
optionalbaseUrl?:string
Defaults to ebitex’s production API. Override for a self-hosted or local deployment.
Inherited from
Section titled “Inherited from”cache?
Section titled “cache?”
optionalcache?:false|CacheOptions
In-memory cache of resolved results (default 50 entries, LRU); false disables it.
context?
Section titled “context?”
optionalcontext?:ContextBag| (() =>ContextBag|Promise<ContextBag>)
The personalization context bag, or a (possibly async) function producing it per resolve. Always sent — {} by default — so the server resolves personalization and tokens.
optionalenv?:string
The delivery environment id, known ahead of time (e.g. a build-time constant) — sent as env= on
the very first /sites//locales request of the session, not only on requests made after a
live /sites response has revealed it. Doesn’t suppress either call (both still fire on every
load) — it only lets them carry env= sooner, which is what makes them edge-cache-eligible from
a session’s first request rather than only its second.
fetch?
Section titled “fetch?”
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Injectable for testing or for a runtime with a non-global fetch.
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”URL | RequestInfo
RequestInit
Returns
Section titled “Returns”Promise<Response>
Call Signature
Section titled “Call Signature”(
input,init?):Promise<Response>
Parameters
Section titled “Parameters”string | URL | Request
RequestInit
Returns
Section titled “Returns”Promise<Response>
Inherited from
Section titled “Inherited from”locale?
Section titled “locale?”
optionallocale?:string| ((locales) =>string|undefined)
The locale code to request: a string, or a function choosing from GET /locales. Omitted: the
first of the browser’s languages (each region tag followed by its base language) present in
the organization’s locale tree; nothing in Node, or when none matches (the server’s default).
referencePaths?
Section titled “referencePaths?”
optionalreferencePaths?:boolean
Ask every read to attach each reference descriptor’s own published address(es) (paths), so a
document that references another page can link to it with no second query. Off by default;
with it off, responses and persisted cache keys are unaffected.
Deliberately a client-level option rather than a per-call one: the resolved shape is part of the cache key, so a per-call flag would split two callers resolving the same location into two requests. A site either wants linkable references or does not.
resolve?
Section titled “resolve?”
optionalresolve?:ResolveStrategy
Default { strategy: 'adaptive' } — full for the first location this client instance
resolves (and every later resolve of it), normalized (depth 1) for any other. In Node,
always full: normalized trades depth for on-demand fetches that only a browser can make,
and one server-side client instance serves every path for the life of the process.
optionalsite?:string| ((sites) =>SiteSummary|undefined)
The site to resolve paths against: a rootNodeId, or a function choosing from GET /sites.
Omitted: the sole published site, else the one whose hosts contains this page’s hostname.
Required in Node when more than one site is published.