ContentClient
Properties
Section titled “Properties”audience
Section titled “audience”
readonlyaudience:AudienceHandle|undefined
The visitor’s audiences: undefined unless the client was created with an audience option.
delivery
Section titled “delivery”
readonlydelivery:DeliveryClient
The low-level client this one is built on — nothing is hidden.
sandbox
Section titled “sandbox”
readonlysandbox: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.
strategy
Section titled “strategy”
readonlystrategy:ResolveStrategy
The strategy in force for this client.
Methods
Section titled “Methods”forVisitor()
Section titled “forVisitor()”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.
Parameters
Section titled “Parameters”visitor
Section titled “visitor”consent?
Section titled “consent?”AudienceConsentSignals | (() => AudienceConsentSignals | undefined)
context?
Section titled “context?”ContextBag | (() => ContextBag | Promise<ContextBag>)
visitor?
Section titled “visitor?”string | null
Returns
Section titled “Returns”ContentClient
getComponent()
Section titled “getComponent()”getComponent(
provider,key,options?):Promise<ExpandedReference<ContentDocument>>
Parameters
Section titled “Parameters”provider
Section titled “provider”string
string
options?
Section titled “options?”Omit<GetComponentOptions, "audienceToken">
Returns
Section titled “Returns”Promise<ExpandedReference<ContentDocument>>
getNavigation()
Section titled “getNavigation()”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.
Parameters
Section titled “Parameters”anchor?
Section titled “anchor?”string
options?
Section titled “options?”Returns
Section titled “Returns”Promise<NavigationTree>
getStreamFacet()
Section titled “getStreamFacet()”getStreamFacet(
stream,field,options?):Promise<StreamFacetResult>
Parameters
Section titled “Parameters”stream
Section titled “stream”string
string
options?
Section titled “options?”Omit<StreamFacetOptions, "audienceToken">
Returns
Section titled “Returns”Promise<StreamFacetResult>
getTree()
Section titled “getTree()”getTree(
options?):Promise<NavigationTree>
The whole site tree in one call — every navigation question then answered locally.
Parameters
Section titled “Parameters”options?
Section titled “options?”Omit<NavigationOptions, "include">
Returns
Section titled “Returns”Promise<NavigationTree>
invalidate()
Section titled “invalidate()”invalidate():
void
Drops every cached result and the memoized site/locale, including anything persisted.
Returns
Section titled “Returns”void
listComponents()
Section titled “listComponents()”listComponents(
options):Promise<ComponentPage>
Parameters
Section titled “Parameters”options
Section titled “options”Omit<ListComponentsOptions, "audienceToken">
Returns
Section titled “Returns”Promise<ComponentPage>
peekLocation()
Section titled “peekLocation()”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.
Parameters
Section titled “Parameters”location
Section titled “location”Returns
Section titled “Returns”PersistedExperience | undefined
peekReference()
Section titled “peekReference()”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.
Type Parameters
Section titled “Type Parameters”TContent
Section titled “TContent”TContent = ContentDocument
Parameters
Section titled “Parameters”descriptor
Section titled “descriptor”Returns
Section titled “Returns”PersistedReference<TContent> | undefined
peekTree()
Section titled “peekTree()”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.
Parameters
Section titled “Parameters”anchor?
Section titled “anchor?”string
options?
Section titled “options?”Returns
Section titled “Returns”NavigationTree | undefined
queryStream()
Section titled “queryStream()”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.
Parameters
Section titled “Parameters”stream
Section titled “stream”string
options?
Section titled “options?”Omit<QueryStreamOptions, "audienceToken">
Returns
Section titled “Returns”Promise<StreamPage>
resolveLocale()
Section titled “resolveLocale()”resolveLocale():
Promise<string|undefined>
Returns
Section titled “Returns”Promise<string | undefined>
resolveLocation()
Section titled “resolveLocation()”resolveLocation(
location,overrides?):Promise<ExperienceResult>
Resolves whatever lives at a location — invoke it on every router change.
Parameters
Section titled “Parameters”location
Section titled “location”overrides?
Section titled “overrides?”Returns
Section titled “Returns”Promise<ExperienceResult>
resolveReference()
Section titled “resolveReference()”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.
Type Parameters
Section titled “Type Parameters”TContent
Section titled “TContent”TContent = ContentDocument
Parameters
Section titled “Parameters”descriptor
Section titled “descriptor”overrides?
Section titled “overrides?”owner?
Section titled “owner?”Returns
Section titled “Returns”Promise<ExpandedReference<TContent>>
resolveSite()
Section titled “resolveSite()”resolveSite():
Promise<ResolvedSite>
Returns
Section titled “Returns”Promise<ResolvedSite>