StreamTarget
Defined in: protocol.ts:46
Everything needed to address one island stream.
Properties
Section titled “Properties”apiBase
Section titled “apiBase”apiBase:
string
Defined in: protocol.ts:48
Base URL of the embed API, e.g. https://api.sparkletree.io.
campaignId?
Section titled “campaignId?”
optionalcampaignId?:string
Defined in: protocol.ts:58
context?
Section titled “context?”
optionalcontext?: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.
extra?
Section titled “extra?”
optionalextra?:Record<string,string|undefined>
Defined in: protocol.ts:83
Extra params passed through verbatim (preview tokens, etc.).
island
Section titled “island”island:
"cta"|"hero"
Defined in: protocol.ts:60
lengths?
Section titled “lengths?”
optionallengths?: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
Section titled “organizationId”organizationId:
string
Defined in: protocol.ts:49
publishableKey?
Section titled “publishableKey?”
optionalpublishableKey?: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.
sessionId?
Section titled “sessionId?”
optionalsessionId?:string
Defined in: protocol.ts:81
Conversation session id for copy continuity. Individual surfaces only.
surfaceId?
Section titled “surfaceId?”
optionalsurfaceId?:string
Defined in: protocol.ts:59
variantId?
Section titled “variantId?”
optionalvariantId?: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.