Skip to content

StreamTarget

Defined in: protocol.ts:46

Everything needed to address one island stream.

apiBase: string

Defined in: protocol.ts:48

Base URL of the embed API, e.g. https://api.sparkletree.io.


optional campaignId?: string

Defined in: protocol.ts:58


optional context?: Record<string, unknown>

Defined in: protocol.ts:73

Context snapshot (time, geo, weather, device, declared placement). Serialised as JSON, with custom dimensions flattened to x.<name> keys as the server reads them.


optional extra?: Record<string, string | undefined>

Defined in: protocol.ts:83

Extra params passed through verbatim (preview tokens, etc.).


island: "cta" | "hero"

Defined in: protocol.ts:60


optional lengths?: Partial<Record<CopyField, number>>

Defined in: protocol.ts:79

The length budget per field, in characters (Unicode code points): the length of each field’s fallback, which sets the size of its slot. Sent as len.<field> so the server writes copy that fits.


organizationId: string

Defined in: protocol.ts:49


optional publishableKey?: string

Defined in: protocol.ts:57

The publishable key (st_pk_live_… / st_pk_test_…): a signed credential minted in the dashboard, required by the server on every stream and content request. Optional in the type only so self-hosters with explicit organizationId/apiBase can still build a URL; with enforcement on, the server refuses a request without it.


optional sessionId?: string

Defined in: protocol.ts:81

Conversation session id for copy continuity. Individual surfaces only.


optional surfaceId?: string

Defined in: protocol.ts:59


optional variantId?: string

Defined in: protocol.ts:67

Variant pinning (plan v1.1 §3.3). The provider resolves the variant ONCE per page view and pins it here for every later call. Without it, ε-greedy runs per request and a single page shows a mixed-variant creative — hero from one arm, CTA from another — which is not an experiment, it is noise.