npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kotao/storefront

v0.2.9

Published

Kotao Storefronts theme SDK — framework-agnostic server runtime, React Router 8 binding, and authenticated source-authoritative React/Hydrogen editor bridge (ADR-0003/ADR-0047). Leaf package (ADR-0006).

Readme

@kotao/storefront

Framework-agnostic theme SDK runtime for Kotao Storefronts (ADR-0003). It mirrors Hydrogen's API so a Hydrogen → Kotao migration is largely mechanical, and papers over the four Cloudflare Workers-for-Platforms untrusted-mode realities (no request.cf, no caches.default, no eval, frozen intra-request clock).

API mapping

| Hydrogen | Kotao | Notes | | ---------------------------------------- | -------------------------------------------------------- | ----------------------------------------------------------------- | | createStorefrontClient | createStorefrontClient | typed GraphQL; SWR-cached query, uncached mutate | | createWithCache | createWithCache | SWR caching for third-party data | | CacheShort / CacheLong / CacheNone | CacheShort / CacheLong / CacheNone / CacheCustom | plus StorefrontDefaultCache (fresh 1s / serve ~1 day) | | createHydrogenContext | createKotaoContext | storefront + geo + cache + locale + session seam | | Oxygen request.cf | context.geo | backed by signed x-kotao-* headers; null if unsigned/tampered | | (Oxygen-managed) | @kotao/storefront/react-router | RR8 getKotaoLoadContext |

The one real migration diff is request.cf → context.geo.

Entry points

  • @kotao/storefront — framework-agnostic core (no React Router import).
  • @kotao/storefront/editor — Liquid settings bridge plus the authenticated, bounded Hydrogen component-instance protocol and preview store.
  • @kotao/storefront/react — Hydrogen-shaped React components and editor-only component boundaries/registry helpers.
  • @kotao/storefront/react-router — the React Router 8 binding (getKotaoLoadContext).

Event approval offers

EventApprovalOffer from @kotao/storefront/events/react accepts an optional formatDateTime callback for the visible event start and offer expiry. Format these in the event's locale and a fixed time zone so server and browser output agree. The original timestamps remain unchanged in the time elements and the offer lifecycle.

Hydrogen editor preview

createHydrogenEditorPreviewRuntime projects manifest-authorized operations into an in-memory instance tree. The source manifest and Git base remain authoritative; this store never writes source or becomes public configuration. Each message is bound to the exact admin/preview origin, expected window, session, base SHA, manifest hash, channel nonce, short-lived preview token, protocol version, message ID, and monotonic sequence. Payloads fail closed above 128 KiB/depth 32, and at most 100 authenticated messages are buffered before Ready.

React themes mount HydrogenEditorProvider only in authenticated editor previews, mark extracted instances with HydrogenEditorBoundary, and use HydrogenEditorSlot for declared insertion boundaries. Per-instance subscriptions let prop/style changes reconcile only the affected subtree; route, loader, Suspense, and HMR reconciliation retains draft operations and reports whether the selection is active or out of route. Ordinary public storefront responses must not mount these overlays or receive editor credentials.

Preview servers turn the opaque token into browser-safe runtime configuration with createHydrogenEditorPreviewBootstrap. The expected binding must come from the trusted edit session, never from request parameters:

const editorBootstrap = await createHydrogenEditorPreviewBootstrap({
  token: requestToken,
  secret: env.HYDROGEN_EDITOR_PREVIEW_GRANT_SECRET,
  expected: trustedEditSession.previewBinding,
  now: Date.now(),
})

An invalid, missing, expired, or incorrectly bound token returns null. Only a non-null result may be serialized into an editor-preview response; the signing secret is never part of that result. Public responses omit both the bootstrap and the editor entry point. In the browser, dynamically import @kotao/storefront/editor only when the server supplied a bootstrap, then call createHydrogenEditorPreviewRuntimeFromBootstrap with currentOrigin: location.origin. The factory refuses to start unless the current preview origin exactly matches the signed binding and targets every runtime message at the signed Workspaces origin.

On editor-only preview hosts, the Gateway's Hydrogen canvas controller measures those stable DOM boundaries and emits same-document interaction intents for move, inline content, bounded layout, and insertion requests. HydrogenEditorProvider is the only consumer: it translates each intent through dispatchCanvasIntent, validates it against the live manifest/slot/capability contract, and only then applies and forwards the preview operation over the authenticated bridge. The DOM controller has no source-write path and cannot bypass unsupported or read-only boundaries.

Signed geo contract

signGeo (used by the Gateway Worker, #81) and verifyGeo (used here) live together so the x-kotao-geo / x-kotao-geo-signature HMAC-SHA256 contract can never drift. The signing key is env.STOREFRONT_GEO_SIGNING_KEY. Any missing/invalid signature yields null — unsigned data is never trusted.

Status: #79 ships the core runtime. The Storefront API GraphQL schema + typed codegen, cart, SEO, analytics, and customer-account surfaces are tracked as separate issues.