Skip to content

ServerContext

Defined in: core/src/visitorContext.ts:81

The visitor context a server derived for one request, for the browser to adopt for the same page view (SparkletreeProvider’s serverContext).

The browser then sends exactly these values instead of reading its own, so its streams and the copy they cache are keyed the way the server read them. A value the server left out is left out by the browser too.

optional deviceType?: DeviceType

Defined in: core/src/visitorContext.ts:82


optional language?: string

Defined in: core/src/visitorContext.ts:87

The visitor’s preferred language tag, e.g. sv-SE.


optional pins?: Record<string, string>

Defined in: core/src/visitorContext.ts:94

The variant the server read for, by pin key: the campaign id, or the surface id for a surface-addressed island. Pinned for the page view before any stream opens, so every island of that campaign or surface tells the same story the server rendered.


optional timeOfDay?: TimeOfDay

Defined in: core/src/visitorContext.ts:83


optional timezone?: string

Defined in: core/src/visitorContext.ts:85

IANA time zone, e.g. Europe/Stockholm.


optional viewId?: string

Defined in: core/src/visitorContext.ts:101

Identifies the page view the server rendered. The provider scopes variant pins, slot memory and impressions to it, so a new server render (a navigation, a refresh) is a new page view in the browser too, and its pins are in place before any island’s stream opens.