Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@thorprovider/runtime

Latest version: v0.19.0

Overview

Last scanned
27 Nov 2026
Published
27 Nov 2026
npm package Publisher: thorprovider
20 Versions
4.3K Downloads

Scan summary

@thorprovider/runtime was last scanned on 27 Nov 2026 at version 0.19.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 20 versions; the latest 5 were published within 7 days (21–27 Nov 2026).
  • Findings: No rules fired in version 0.19.0.
  • Downloads: 4,282 downloads.

Versions

20 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.19.0 LATEST 27 Nov 2026 No rules fired
0.18.0 25 Nov 2026 No rules fired
0.17.0 23 Nov 2026 No rules fired
0.16.0 21 Nov 2026 Not shown
0.15.0 21 Nov 2026 Not shown

No rules fired in 0.19.0

Findings

Findings for v0.19.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.19.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.


title: "@thorprovider/runtime" purpose: "Multitenant storefront runtime: tenant resolution, theming, spec-driven rendering and commerce data for Next.js hosts" lastReviewed: "2026-10-02"

@thorprovider/runtime

Multitenant storefront runtime for Thor Commerce. It converts a serializable json-render spec into real Next.js pages, resolves the tenant by hostname, applies per-tenant theming as CSS variables, and feeds data through loaders from the @thorprovider/types canon.

It is the package every Thor Commerce storefront mounts: projects/electrostore uses it directly, and every storefront generated by @thorprovider/storefront imports from it.

This README is organised in two parts:

  • Getting started — for consumers who want to mount the runtime in a Next.js host and render a storefront. Start here.
  • Development — for maintainers working on the package itself. See Development.

Getting started

Prerequisites
Requirement Supported
Next.js ^16.0.0 (peer dependency)
React / React DOM ^19.0.0 (peer dependencies)
Data provider @thorprovider/adapters (bundled as a dependency; mock works offline)
Install
yarn add @thorprovider/runtime

The package ships layered subpath exports (see Subpath entry points). Import from the layer you need — never from the root in app code.

The four layers
+------------------------------------------------------------+
|                    your Next.js host (app/)                |
+------------------------------------------------------------+
      |                              |
      v                              v
+-------------+   theme vars  +--------------+
|  host-glue  | ------------> | render-core  |
| (Next/React)|               | (Next/React) |
+-------------+               +--------------+
      |                              |
      v                              v
+-------------+               +--------------+
|  contracts  |               |   commerce   |
| (pure Zod)  |               | (server TS)  |
+-------------+               +--------------+
      ^                              ^
      |        @thorprovider/types canon    |
      +------------------------------+
Layer Subpaths Bound to Role
host-glue /host-glue, /host-glue/providers, /host-glue/tenant-resolver Next.js + React Mount the runtime in a host: resolve the tenant by hostname, provide the renderer context, SEO helpers
render-core /render-core, /render-core/app, /render-core/theme, /render-core/registry Next.js + React Turn a spec into routes: catalog of blocks, component registry, theming, createStorefrontApp
contracts /contracts none (pure Zod/TS) Shared contracts: theme tokens, spec shapes, tenant config/registry, resolution, env
commerce /commerce server-side TS Data bridge over @thorprovider/adapters: catalog reads, cart/checkout service, canon-to-blocks transforms
Quick start — multitenant host

Three pieces, following the canonical projects/electrostore mount.

1. Root layout — resolve the tenant, derive theme CSS, wrap in the provider (app/layout.tsx):

import { resolveTenantFromRequest } from '@thorprovider/runtime/host-glue/tenant-resolver'
import { StorefrontProvider } from '@thorprovider/runtime/host-glue/providers'
import { themeTokensToVars, themeVarsToCss } from '@thorprovider/runtime/render-core/theme'
import { tenantRegistry } from '@/lib/tenant'
import { registry } from '@/lib/registry'

export async function generateMetadata() {
  const resolution = await resolveTenantFromRequest(tenantRegistry)
  return resolution.status === 'found'
    ? { title: resolution.tenant.seo.title, description: resolution.tenant.seo.description }
    : {}
}

export default async function RootLayout({ children }: { children: React.ReactNode }) {
  const resolution = await resolveTenantFromRequest(tenantRegistry)
  if (resolution.status === 'not-found') {
    return <h1 className="p-8 text-2xl font-semibold">Store not found</h1>
  }
  const themeCss = themeVarsToCss(themeTokensToVars(resolution.tenant.theme))
  return (
    <body>
      <StorefrontProvider themeCss={themeCss} registry={registry}>
        {children}
      </StorefrontProvider>
    </body>
  )
}

2. Runtime module — build the app from a spec and loaders (lib/<name>/runtime.ts):

import { createStorefrontApp } from '@thorprovider/runtime/render-core/app'
import { getCatalog, getDataSource, getProductByHandle } from '@thorprovider/runtime/commerce'
import { spec } from './spec'

const loaders = {
  catalog: async () => ({ catalogProducts: (await getCatalog()).products }),
  product: async (params) => {
    if (getDataSource() === 'mock') return { selectedProduct: mockProduct(params.id) }
    return { selectedProduct: await getProductByHandle(params.id) }
  },
}

export const app = createStorefrontApp({ spec, loaders })

3. Catch-all route — the app drives the page (app/[[...slug]]/page.tsx):

import { notFound } from 'next/navigation'
import { app } from '@/lib/runtime'
import { PageRenderer } from '@json-render/next'

export const { generateMetadata, generateStaticParams } = app

export default async function Page({ params }: { params: Promise<{ slug?: string[] }> }) {
  const data = await app.getPageData({ params })
  if (!data) return notFound()
  return <PageRenderer {...data} />
}
Quick start — single-tenant site

Generated storefronts skip tenant resolution and theme from the default tokens (packages/storefront template):

import { DEFAULT_THEME_TOKENS } from '@thorprovider/runtime/contracts'
import { themeVarsToCss, themeTokensToVars } from '@thorprovider/runtime/render-core/theme'

const themeCss = themeVarsToCss(themeTokensToVars(DEFAULT_THEME_TOKENS))
// then the same <StorefrontProvider themeCss={themeCss} registry={registry}> mount
Data source configuration

/commerce resolves its provider from the environment (THOR_DATA_SOURCE=mock is the default and needs nothing):

Variable Used for
THOR_DATA_SOURCE mock (default, offline demo data) or medusa
MEDUSA_BASE_URL Medusa backend URL (required in medusa mode)
MEDUSA_PUBLISHABLE_KEY Medusa publishable key (required in medusa mode)
MEDUSA_REGION_ID Region pricing and region-scoped queries
MEDUSA_CURRENCY_CODE Optional currency override
MEDUSA_SALES_CHANNEL_ID Channel scoping (preferred; read by the adapter)
NEXT_PUBLIC_SALES_CHANNEL_ID Legacy fallback for channel scoping

When the live provider fails, the bridge falls back to mock data and reports it via console.warn and the source field — it never fails the render silently.

Subpath entry points

Entry point Exports
@thorprovider/runtime/host-glue StorefrontProvider, StorefrontLayout, resolveTenantFromRequest, hostnameFromRequestHeaders, requireTenant, tenantMetadata
@thorprovider/runtime/host-glue/providers StorefrontProvider
@thorprovider/runtime/host-glue/tenant-resolver resolveTenantFromRequest, hostnameFromRequestHeaders
@thorprovider/runtime/render-core createStorefrontApp, catalog, registry, handlers, validateSpecForCatalog, theme utils
@thorprovider/runtime/render-core/app createStorefrontApp
@thorprovider/runtime/render-core/theme themeTokensToVars, themeVarsToCss, cssVarsToStyle, accentColorToOklch
@thorprovider/runtime/render-core/registry registry, handlers
@thorprovider/runtime/contracts Zod schemas and types: theme tokens, spec shapes, tenant config/registry, DEFAULT_THEME_TOKENS, env
@thorprovider/runtime/commerce getCatalog, getProductByHandle, cart/checkout service, transforms, getDataSource

Documentation

  • Getting started — host mounting walkthrough
  • host-glue — tenant resolution and providers
  • render-core — spec-driven rendering
  • contracts — Zod contracts
  • commerce — data bridge and cart service

Development

yarn workspace @thorprovider/runtime build        # tsup
yarn workspace @thorprovider/runtime dev          # tsup --watch
yarn workspace @thorprovider/runtime test         # vitest run
yarn workspace @thorprovider/runtime type-check   # tsc --noEmit
Layer boundaries

The layers are separated by an invariant that agents and reviewers enforce:

  • host-glue and render-core are Next/React-bound (.tsx, import next/*, react, @json-render/next).
  • contracts is pure Zod/TypeScript — no React, no Next.js.
  • commerce is JSX-free and Next-free server TypeScript. Its only React touch is cache() from react in the bridge for per-request memoization.
Regenerating AGENTS.md

packages/runtime/AGENTS.md and the root AGENTS.md are generated:

yarn generate:agents-index

CI fails if they are out of sync with the generator.

Maintenance

  • Docs here and in docs/ describe the exported surface of each layer. When a subpath export changes, update the affected doc in the same commit.
  • The behavioral contract for this package lives in openspec/specs/storefronts-runtime/spec.md (Spanish). These docs derive from it; the spec wins on conflict.
  • Publishing follows the repo changesets flow — see PUBLISHING_GUIDE.md at the repo root.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @thorprovider/runtime

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

PolinRider Returns
Research

PolinRider Returns: Hijacked npm Packages Use Ethereum Blockchain to Conceal Malware Infrastructure

Vulnerability Insights

Compromised Claude Code extensions (versions 2.1.312 & 2.1.313) in Cursor try to install a backdoor

Frame 2085668439 (1)
Group 1261154229