@kotao/storefront
The theme runtime SDK. Server helpers live on the root entrypoint; UI building blocks under
/react; focused utilities under their own subpaths. This page is an entrypoint map — deeper
per-symbol documentation is generated in a later release.
@kotao/storefront (root)
Section titled “@kotao/storefront (root)”Server-side toolkit used from your Worker entry and route loaders:
- Context & client —
createKotaoContext,createStorefrontClient: the per-request context your loaders reach ascontext.storefront. - Cart —
createCartHandler,CartFormactions (CART_FORM_ACTIONS),applyOptimisticCartAction, cart-id cookie helpers. - Caching —
CacheShort,CacheLong,CacheNone,CacheCustom,createWithCache,generateCacheControlHeader. - SEO & routing —
getSeoMeta, JSON-LD builders (productJsonLd,organizationJsonLd, …),storefrontRedirect, sitemap/robots responses. - Localization — locale detection (
localeFromRequest,localizePath,stripLocalePrefixFromRequest), the localization form handler. - Consent & analytics — consent cookie encode/decode,
createAnalyticsEmitter,getShopAnalytics. - Checkout —
resolveCheckoutUrl, checkout consent passthrough, design-token extraction. - Pagination —
getPaginationVariables,getPaginationInfo,flattenConnection.
@kotao/storefront/react
Section titled “@kotao/storefront/react”Client components and hooks: Image, Money / useMoney, Seo, Pagination, MediaFile,
CartForm + OptimisticInput / useOptimisticData, Analytics* views + useAnalytics,
ConsentBanner, ShopPayButton, theme settings via ThemeSettingsProvider /
useThemeSettings / useSectionSettings, and openSmartCart for the platform cart drawer.
@kotao/storefront/react-router
Section titled “@kotao/storefront/react-router”The React Router 7 binding: getKotaoLoadContext (wire the Worker request into your routes)
plus defer / json compat re-exports.
@kotao/storefront/product
Section titled “@kotao/storefront/product”Variant selection logic: getProductOptions, getSelectedVariant,
getSelectedProductOptions, getAdjacentAndFirstAvailableVariants, useOptimisticVariant,
useSelectedOptionInUrlParam.
@kotao/storefront/image
Section titled “@kotao/storefront/image”imageUrl, imageSrcSet, buildImageAttrs — CDN image URLs with transforms, and complete
<img> attribute sets (dimensions included, CLS-safe).
@kotao/storefront/seo
Section titled “@kotao/storefront/seo”The SEO toolkit standalone: getSeoMeta, JSON-LD builders, robotsResponse,
sitemapResponse / sitemapIndexResponse, storefrontRedirect.
@kotao/storefront/settings
Section titled “@kotao/storefront/settings”Settings-as-data plumbing: fetchThemeSettings, resolveThemeSettings, mergeSettings /
mergeSection, createThemeSettingsStore.
@kotao/storefront/editor
Section titled “@kotao/storefront/editor”createStorefrontEditorBridge / createStorefrontEditorHostBridge — the live-preview bridge
the Workspace theme editor uses to talk to your theme.
Other entrypoints
Section titled “Other entrypoints”/cart-documents (the cart GraphQL documents), /storefront-api-types and
/customer-account-api-types (generated API types).