Skip to content

SparkletreeContextValue

Defined in: react/src/provider.tsx:44

@sparkletree/react — React bindings for the SparkleTree SDK.

Two layers, and the boundary between them is the whole design:

  • PRIMITIVES (StreamText, useIsland) live in npm. They speak the wire, own the choreography, and carry the trust chrome structurally. They are ours to patch.
  • COMPONENTS (Hero, Cta) also ship as copy-paste source through sparkletree add. Those copies are the customer’s, and they are wire-ignorant by construction — no event names, no protocol versions, no timing constants — so a protocol change never obliges a customer to re-copy anything.

apiBase: string

Defined in: react/src/provider.tsx:45


apiBaseProvenance: "key" | "explicit"

Defined in: react/src/provider.tsx:49

Where apiBase came from — a key-derived base cannot be verified client-side and earns no mint POST unless first-party (see core’s maybeMint, S-2).


context: Record<string, unknown>

Defined in: react/src/provider.tsx:55

Context snapshot sent with every request in this page view.


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

Defined in: react/src/provider.tsx:62

Test seam; defaults to the platform fetch.

MDN Reference

URL | RequestInfo

RequestInit

Promise<Response>


optional mintToken?: MintTokenSource

Defined in: react/src/provider.tsx:60

Signed mint token for fragment minting, if the page was given one.


organizationId: string

Defined in: react/src/provider.tsx:50


prefersStandard: boolean

Defined in: react/src/provider.tsx:57

Viewer asked for the standard (unmarked, unadapted-looking) version.


optional publishableKey?: string

Defined in: react/src/provider.tsx:53

The signed publishable key, carried on every stream/content target as st-key. Absent only for self-hosters passing explicit props.


setPrefersStandard: (value) => void

Defined in: react/src/provider.tsx:58

boolean

void


viewId: string | null

Defined in: react/src/provider.tsx:68

The page view the islands below belong to: viewKey, else the server read’s view, else null (one implicit view until the last provider unmounts or pageVariants.reset()).