Skip to content

ChoreographerOptions

Defined in: state.ts:226

optional clearTimeout?: (handle) => void

Defined in: state.ts:327

unknown

void


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.


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.


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.


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.


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().


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.


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.


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.


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.


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.


optional initialVariantId?: string

Defined in: state.ts:274

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


optional now?: () => number

Defined in: state.ts:328

number


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.


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.


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

Defined in: state.ts:326

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

() => void

number

unknown


optional unfinishedCopy?: UnfinishedCopyPolicy

Defined in: state.ts:304

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