{{item.*}} interpolation, dataSource scope, client refetch via stateInputs.
Repeaters, connector queries, and {{variable}} interpolation. Everything you need to make a section iterate over Stripe products, customer orders, or a nested array on its parent item — and to drop live values into Text, Buttons, Images, and Links.
Looking for the full TypeScript type? See
DataSourceinuseDataSource.tsxand the resolver invariables.ts. This doc covers what each field is for and when you'd reach for it.
Wrap repeating children in a Data node, point it at a provider/collection, then use {{item.*}} inside its descendants:
Inside card_id (or anything under it):
That's it. The SSR scanner fetches the collection, hydrates each child with one item, and the resolver swaps in the values.
Everything Data can carry, in one block:
Three modes, exactly one per node:
provider + collection. Fetched at SSR, refetched client-side when stateInputs change.scope: "item.images". Iterates a path INTO the parent repeater item. No fetch.scope + splitBy. Splits a delimited string into pseudo-items.{{...}} resolvesInterpolation runs through replaceVariables. It is not universal — only these surfaces resolve:
| Where | How to write it |
|---|---|
Text node props.text | Inline <span data-variable="item.title" class="variable-node">{{item.title}}</span> (matches TipTap output). |
Button / Link text | Bare {{item.title}}. Item context is auto-injected. |
Button / Link action.href | Bare {{item.slug}} — works in any href shape: ref:page_product/{{item.slug}}, /shop?id={{item.id}}, mailto:{{item.email}}. |
Button / Link / Container / FormElement attrs values | Bare {{item.*}}. String values only. |
Image src and alt | Bare {{item.src}} / {{item.image}}. |
FormElement placeholder / value / options | Bare {{...}}. |
Does NOT resolve in: plain text inside Container children (write a Text node), arbitrary non-attrs props, or className. If you find yourself wanting {{item.x}} inside a className, you want a stateModifier or a different node shape.
All of these work everywhere interpolation runs. Pick by what you're reading:
| Prefix | Resolves against | Example |
|---|---|---|
item.* | The current repeater item (set by the enclosing Data node). | {{item.title}}, {{item.metadata.color}} |
connector.* | Global server data: connector.<provider>.bindings.<bindingId>.0.<field> — useful outside a repeater. | {{connector.stripe.bindings.demo-products.0.title}} |
state.* | Central state registry. Splits on first . after the last :. JSON values walk deeper. | {{state.url:page}}, {{state.pdp:abc:matching-variant.formatted}} |
auth.* | Site-customer auth (set via setAuthState in the host app). | {{auth.status}}, {{auth.customer.email}} |
company.* | ROOT.props.company — falls back to a sensible default ("Acme Inc." etc.) so empty templates render. | {{company.name}}, {{company.email}} |
variables.* | Custom variables on ROOT.props.variables[], or runtime overrides via window.PageHub.setVar(...). | {{variables.brandName}} |
anchor.* | Wrapper-supplied anchor ids. Resolved in a pre-pass so nested forms like {{state.{{anchor.chat}}:title}} work. | {{anchor.chat}} |
year | Current year (no prefix needed). | {{year}} |
Unresolved item.* / connector.* / auth.* / variables.* render as empty string (not the literal {{...}}) so pre-hydration repeater skeletons look clean. Other unresolved tokens render as-is.
The resolver uses walkPath which splits paths on . only. These rules trip people up:
Array indexing uses dot-digit, not brackets.
- ✅
{{item.images.1}}— second image- ❌
{{item.images[1]}}— does not resolve, renders emptySame rule applies inside
item-typed conditions:key: "images.1"works,key: "images[1]"does not.
||fallback is one level deep, and the fallback is a literal string.
{{a || b}}→ resolvesa, or the literal text"b"ifais empty{{a || b || c}}→ resolvesa, or the literal text"b || c"(the second||is not parsed)- The fallback is never resolved as another variable. There is no "fall back to
item.image_2ifitem.image_1is missing" via||.For "fallback to another variable" (e.g. hover image → primary when only one image exists), add an
itemcondition on the node —{ type: "item", key: "images.1", operator: "exists" }— and hide it when the second image isn't there. Conditions use the samewalkPath, so the dot-digit rule applies there too.
The resolver also understands a narrow ternary syntax — {{auth.status == logged-in ? Account : Sign in}} — with spaces required around the : to avoid clobbering ref: and https:. See replaceVariables for the exact regex.
Server data lives under connector.<provider>.bindings.<bindingId>. bindingId defaults to a hash of (provider, collection, filter, sort, limit). Set dataSource.bindingKey: "demo-products" to pin a stable id when:
connector.stripe.bindings.demo-products.0.title).Pagination totals + hasMore live alongside on bindingsMeta. Read them via getBindingMeta(provider, bindingId) from the SDK, or via publishStateKeys (below).
Stripe storefront filter:
filter: { demo: "true" }on storefront blocks is load-bearing — it segments storefront items from platform SKUs. Don't drop it. The MCP / API editor search at/api/v1/sites/.../stripedoes NOT apply it (intentional: editor surfaces the full catalog).
stateInputs and publishStateKeysConnector-backed Data nodes can subscribe to state keys and refetch when they change. This is how storefront filter forms, pagination chrome, and search inputs stay live without a page reload.
stateInputs — map fetch options to state keys:
The buyer's order on a checkout return page is the same mechanism: { provider: "order", collection: "session", stateInputs: { session: "url:session_id" } } (fields in ecommerce-gaps.md "After checkout"). Client-only bindings like this one can carry a custom.dataRole: "empty" child; on the static walker it ships as <template data-empty-template> and shows when the fetch returns no rows. A nested scope: "item.*" repeater inside a client-fetched row ships its own template (data-scope-path, slots escaped as {{slot^:…}}) and the runtime fills it per row.
When any subscribed key changes, the connector calls the host-registered client fetcher with the merged snapshot. A refetch keeps the binding's own query: its filter, limit, sort and facetKeys go with every request on both renderers (applyDataSourceScope / clientFetchOptions in dataSourceScope.ts; the static walker stamps them as data-fetch-opts). Without that, a grid filtered to one category showed the whole catalog after the first search. public-data returns meta (totalPages / totalCount) with each page of rows, and both renderers publish it through publishStateKeys. The customer provider (me / orders) is served by public-data too: cookie-scoped, no-store, customer_read rate limit, so account pages work on static sites.
To drop a one-shot URL param (a sign-in or share token), call stripUrlParams([...]) from urlQueryBridge.ts. Removing it from the address bar alone isn't enough: the bridge has already copied it into url:<param>, and its next sync writes it back. The URL ↔ state bridge (urlQueryBridge.ts, mounted by useViewerSetup) keeps URLSearchParams and state["url:*"] in lockstep automatically — so ?q=hat&page=2 round-trips through the registry without bespoke code.
collection grid (chips)To filter a first-party collection grid on a known field (e.g. a status select — Sold / For Sale / Pending) with single-select chips, declare the facet param directly in stateInputs using a facet.<key> option key:
Buttons: active one fires set-state url:facet.status=<Value>; the reset ("Any") fires clear-state url:facet.status. Highlight the active chip with stateModifiers reading state url:facet.status equals <Value> (identical wiring to category chips).facet.<key> option key is forwarded verbatim as a ?facet.<key>= query param; the collection query engine matches it against the denormalized q.metadataTokens.<key> column and ANDs it with category / any other filter (so category + status combine).type: "select" or facetable: true are written into q.metadataTokens at row-write (rowWrites.ts → facetKeysFromSchema). A plain text field can't be facet-filtered this way — make it a select or set facetable: true.storefront-facet-filter block) handles unknown facet keys via a global collector that's gated to the products / products.facets storefront bindings. A known single field doesn't need that — declaring facet.<key> in stateInputs subscribes + forwards through the standard pipe and scopes the refetch to exactly this grid (an incidental sibling binding, e.g. a filter-pinned featured card, is untouched). Don't name the key anything else (statusFacet, status, …) — only a literal facet.<key> is parsed into facetFilters server-side.[], not just an empty SSR result).publishStateKeys — write fetch metadata back into the registry after each fetch:
Pagination chrome reads these via {{state.connector:demo-products:totalPages}} or gates visibility through state-type conditions (e.g. hide a "Next" button when connector:demo-products:page equals connector:demo-products:totalPages).
Scope-only dataSources (scope: "item.images") ignore both fields — there's no fetch to subscribe or publish.
For client-side refetch to work at all, your host app needs to register a fetcher once at boot. Same pattern as registerSubmissionHandler / registerMediaUploadHandler:
See extensibility.md for the full signature and error semantics.
item actually isWhen SSR resolves a Data node, it hands each child render the matching item via ItemProvider. Inside that subtree:
{{item.*}} reads from that item.Data node with scope: "item.images" opens a new item context for its descendants (the parent item is no longer reachable through item.*).{ id, value, title, slug, src, image } so the same templates work for arrays of strings and arrays of objects. Bind chip text via {{item.value}}, slugs via {{item.slug}}, image tiles via {{item.src}}.Button attrs (e.g. data-product-id="{{item.id}}") resolves against the closest item ancestor — handy for click handlers that need to read which row got clicked.href / text / conditional triggers → actions-and-handlers.md