Esc

Sitemap Schema

Complete field reference for streak.sitemap.json.


Full Example

[
  {
    "url": "/",
    "renderConfig": {
      "renderId": "homeRenderId",
      "metadata": {},
      "dataHandler": "HomeDataHandler",
      "rootLayout": "MainLayout",
      "widgets": [
        { "id": "PageHead",     "type": "PageHead" },
        { "id": "HelloBanner",  "type": "HelloBanner" },
        { "id": "HelloMessage", "type": "HelloMessage", "loadingStrategy": "lazy" }
      ],
      "version": "1.0.0"
    }
  }
]

Top-Level Array

The sitemap file is a JSON array. Each element is a page entry.


Page Entry Fields

FieldTypeDescription
urlstringThe URL path for this page
renderConfigobjectAll rendering configuration for this page

renderConfig Fields

FieldTypeDescription
renderIdstringUnique ID across all sitemap entries. Written into the page's build output as an identifier.
metadataobjectPassed as the first argument to the data handler ((metadata, { common }) => {...}) and to the layout component.
dataHandlerstringFilename without extension in src/handlers/
rootLayoutstringFilename without extension in src/layouts/
widgetsarrayOrdered list of widget entries for this page
versionstringUsed as part of the build output path: out/<url>/<version>/raw-content.json

Widget Entry Fields

FieldTypeRequiredDescription
idstringYesAny string identifying this widget slot. Must match the WidgetPlaceholder id= in the layout and the key returned by the data handler. Must be unique within this entry's widgets[]. Not required to equal type.
typestringYesThe widget name. Must match the filename in src/widgets/ (case-sensitive, without extension). May be shared by multiple entries on the same page.
loadingStrategy"lazy"NoWhen set, only a lightweight skeleton placeholder ships in the initial payload — the widget's real HTML and scripts are fetched and swapped in after page load

id vs type

id and type are independent fields:

  • type — the widget component to render. Resolves to src/widgets/<type>.tsx. Multiple entries on a page can share one type.
  • id — the instance key. Selects the handler data slice (props.data = handlerReturn[id]) and the layout slot (WidgetPlaceholder id=). Must be unique among the entry's widgets[].

They hold the same string in most examples purely for readability. To place the same widget in two spots on one page, give two entries the same type and different ids:

"widgets": [
  { "id": "featuredProducts", "type": "ProductList" },
  { "id": "newArrivals",      "type": "ProductList" }
]

<Script> ids are deduplicated per page: a reused widget type must produce a distinct <Script id> per instance, or only the first instance's client script ships.


renderId Uniqueness

renderId must be globally unique across all sitemap entries — it's written into each page's build output and used to identify the page. Duplicate renderId values can cause ambiguity between pages.


File Lookups

Sitemap fieldResolved to
"dataHandler": "HomeDataHandler"src/handlers/HomeDataHandler.ts
"rootLayout": "MainLayout"src/layouts/MainLayout.tsx
"type": "HelloBanner"src/widgets/HelloBanner.tsx

All lookups are by filename without extension. Matching is case-sensitive.