Skip to content

ContentClient

readonly audience: AudienceHandle | undefined

The visitor’s audiences: undefined unless the client was created with an audience option.


readonly delivery: DeliveryClient

The low-level client this one is built on — nothing is hidden.


readonly sandbox: SandboxMode | null

The sandbox mode the API last reported (development, cutover) or null when this is an ordinary organization — see sandboxRobots for what a page built from a sandbox response should carry. Reflects the last response read from the network, so a result served from this client’s cache does not refresh it.


readonly strategy: ResolveStrategy

The strategy in force for this client.

forVisitor(visitor): ContentClient

A client for one visitor, for a server that handles many: the same options with this request’s visitor token, consent and context, and its own caches, so one visitor’s content is never served to another. Create one per incoming request. Without an audience option it is a plain copy.

AudienceConsentSignals | (() => AudienceConsentSignals | undefined)

ContextBag | (() => ContextBag | Promise<ContextBag>)

string | null

ContentClient


getComponent(provider, key, options?): Promise<ExpandedReference<ContentDocument>>

string

string

Omit<GetComponentOptions, "audienceToken">

Promise<ExpandedReference<ContentDocument>>


getNavigation(anchor?, options?): Promise<NavigationTree>

The published Experience tree, for navigation — site and locale come from this client, so a consumer names only the anchor and what it wants relative to it. Cached, deduped, and persisted like every other resolve.

anchor is a node Guid or a published path; omitted, the site root. Each named use case is one call: ['ancestors', 'self'] a breadcrumb, ['children'] a nav menu, ['siblings'] a pager.

string

NavigationOptions

Promise<NavigationTree>


getStreamFacet(stream, field, options?): Promise<StreamFacetResult>

string

string

Omit<StreamFacetOptions, "audienceToken">

Promise<StreamFacetResult>


getTree(options?): Promise<NavigationTree>

The whole site tree in one call — every navigation question then answered locally.

Omit<NavigationOptions, "include">

Promise<NavigationTree>


invalidate(): void

Drops every cached result and the memoized site/locale, including anything persisted.

void


listComponents(options): Promise<ComponentPage>

Omit<ListComponentsOptions, "audienceToken">

Promise<ComponentPage>


peekLocation(location): PersistedExperience | undefined

The persisted result of the last successful resolveLocation for this location, if any — synchronous, no request. undefined when persistence is off, storage is unavailable, there is no entry, it has expired, or preview is activated.

LocationLike

PersistedExperience | undefined


peekReference<TContent>(descriptor): PersistedReference<TContent> | undefined

The persisted result of the last successful resolveReference for this descriptor, if any — synchronous, no request. Same absence rules as peekLocation. TContent asserts, exactly as it does on resolveReference.

TContent = ContentDocument

ReferenceLike

PersistedReference<TContent> | undefined


peekTree(anchor?, options?): NavigationTree | undefined

The persisted result of the last successful matching getNavigation/getTree, if any — synchronous, no request. Same absence rules as peekLocation.

string

NavigationOptions

NavigationTree | undefined


queryStream(stream, options?): Promise<StreamPage>

The raw stream and Component reads, made with the visitor’s current audience token when the client has an audience option (and with none otherwise): the same token resolveLocation sends, renewed the same way. They are not cached, so one visitor’s answer is never served to another. Pass site yourself where the raw client needs it; the token is never an option here.

string

Omit<QueryStreamOptions, "audienceToken">

Promise<StreamPage>


resolveLocale(): Promise<string | undefined>

Promise<string | undefined>


resolveLocation(location, overrides?): Promise<ExperienceResult>

Resolves whatever lives at a location — invoke it on every router change.

LocationLike

ResolveOverrides

Promise<ExperienceResult>


resolveReference<TContent>(descriptor, overrides?, owner?): Promise<ExpandedReference<TContent>>

Resolves one unexpanded reference (the normalized strategy), applying the descriptor’s own contextual overlay. An already-resolved value is returned as-is. owner identifies the fetch that produced this descriptor — required to resolve an Adapter-bearing descriptor, since only a resolve of the owning document can apply the edge’s Adapter; omitted, an adapted descriptor throws adapter_requires_server_resolve (the low-level, owner-less contract). With an owner, the SDK resolves it at depth 1 first, escalating to full once (bounded, cached) if the edge is still unreached there — the case of a relayed Presentation nested one hop deeper.

TContent = ContentDocument

ComponentValue

ResolveOverrides

OwnerRef

Promise<ExpandedReference<TContent>>


resolveSite(): Promise<ResolvedSite>

Promise<ResolvedSite>