Skip to content

StreamOptions

Defined in: client.ts:73

optional choreographer?: CopyChoreographer

Defined in: client.ts:87

Drive an existing choreographer instead of creating one. For a renderer that started holding before the request could open (a stream waiting on a shared variant): one choreographer, so one hold budget, spans the wait and the stream. The choreographer options in these options are ignored when this is set.


optional clearTimeout?: (handle) => void

Defined in: state.ts:327

unknown

void

ChoreographerOptions.clearTimeout


optional fallback?: Partial<Record<CopyField, string>>

Defined in: state.ts:324

The authored fallback, when initial is other copy (for example copy already produced for this view). It is what keepFallback lands. Defaults to initial.

ChoreographerOptions.fallback


optional fallbackDefinesSlots?: boolean

Defined in: state.ts:311

When true, the fallback decides which fields exist: a field whose initial copy is empty is never shown, and the stream’s copy for it is dropped. A slot sized by its fallback has no room for a field the fallback does not have. Ignored when initial has no copy at all.

ChoreographerOptions.fallbackDefinesSlots


optional fetchImpl?: (input, init?) => Promise<Response>

Defined in: client.ts:77

Swap the transport (SSR, tests, a customer’s instrumented fetch).

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>


optional holdElapsedMs?: number

Defined in: state.ts:265

How long the slot has ALREADY been holding before this choreographer took over — for example, since a server-rendered reservation first painted. It is spent from the budget and from the absolute maximum, so the wait before hydration and the wait after it are one hold. Defaults to 0.

ChoreographerOptions.holdElapsedMs


optional holdMs?: number

Defined in: state.ts:258

The hold budget for this view. Defaults to COPY_HOLD_MS; restarts once when the stream proves alive. However the restart falls, the hold never lasts longer than twice this in total.

ChoreographerOptions.holdMs


optional holdStartsInView?: boolean

Defined in: state.ts:289

When true, the hold budget does not start until slotInView() is called. The stream may open (and buffer) earlier; a slot that never comes into view never shows anything changing. When false (the default), the slot is treated as in view from streamOpened().

ChoreographerOptions.holdStartsInView


optional initial?: Partial<Record<CopyField, string>>

Defined in: state.ts:231

The fallback: what lands if live copy does not arrive in time. Required by doctrine — there is no skeleton mode.

ChoreographerOptions.initial


optional initialIsComplete?: boolean

Defined in: state.ts:282

With serverRendered: the initial copy is the WHOLE copy for this view, so the stream writes no field, empty ones included. Use it for copy decided before the slot was shown (for example cached copy a server read for this visitor): a field it left empty stays empty rather than gaining text later.

ChoreographerOptions.initialIsComplete


optional initialIsOnScreen?: boolean

Defined in: state.ts:241

True when the initial copy is ALREADY VISIBLE when the stream opens: copy at rest from earlier in this view, or a fallback the page revealed before the SDK could hold it. Every non-empty field is then final for this view: no hold, and the stream’s copy events for it are dropped.

Leave it unset for copy that has not been seen yet — the normal case. The hold then keeps the slot blank until live copy or the fallback lands.

ChoreographerOptions.initialIsOnScreen


optional initialSource?: "generated" | "cached" | "static"

Defined in: state.ts:272

Provenance of the initial copy when it is finished creative (serverRendered), for example copy already generated for this view. Those fields carry it as their source and are settled from the start. Defaults to static.

ChoreographerOptions.initialSource


optional initialSources?: Partial<Record<CopyField, "generated" | "cached" | "static">>

Defined in: state.ts:318

Per-field provenance of the initial copy when it is finished creative (serverRendered). Overrides initialSource for the fields it names, for copy that mixes provenance, such as live copy for one field and the fallback for another.

ChoreographerOptions.initialSources


optional initialVariantId?: string

Defined in: state.ts:274

The variant the initial copy belongs to, if known. Seeds variantId.

ChoreographerOptions.initialVariantId


optional now?: () => number

Defined in: state.ts:328

number

ChoreographerOptions.now


optional onProtocolUnsupported?: (info) => void

Defined in: client.ts:93

Called when the server cannot speak the version this build requested. The SDK has already kept its own first paint by the time this fires; the hook exists so a consumer can log it once, not so it can retry.

number

number[]

void


optional onState?: (state) => void

Defined in: client.ts:79

Called on every state change.

CreativeState

void


optional releaseOn?: "complete" | "text"

Defined in: state.ts:301

When the held canvas is handed to the stream.

"text" (default): on the first text the stream delivers — live copy types into the blank slot.

"complete": only when the stream finishes (done), so the whole new copy lands at once. For a slot whose canvas is showing something else in the meantime (a campaign or context change); the hold budget still applies.

ChoreographerOptions.releaseOn


optional serverRendered?: boolean

Defined in: state.ts:252

True when the initial copy is FINISHED CAMPAIGN CREATIVE rendered by the platform — not a developer’s fallback. It is the copy for this view: nothing holds, and the stream’s copy events for those fields are dropped (theme, media and the action still apply). Fields left empty may still be written by the stream.

Do not set it for a fallback: a fallback is what lands only when live copy does not.

ChoreographerOptions.serverRendered


optional setTimeout?: (fn, ms) => unknown

Defined in: state.ts:326

Injectable for tests; defaults to the platform timers and clock.

() => void

number

unknown

ChoreographerOptions.setTimeout


optional signal?: AbortSignal

Defined in: client.ts:75


target: StreamTarget

Defined in: client.ts:74


optional unfinishedCopy?: UnfinishedCopyPolicy

Defined in: state.ts:304

What happens to a field the stream was still writing when it ended. Defaults to keepUnlessClearlyError.

ChoreographerOptions.unfinishedCopy