---
title: What Still Runs on the SFCC Backend in Storefront Next
canonical_url: >-
  https://rhino-inquisitor.com/what-still-runs-on-the-sfcc-backend-in-storefront-next/
markdown_url: >-
  https://rhino-inquisitor.com/what-still-runs-on-the-sfcc-backend-in-storefront-next/index.md
content_type: article
site_name: Rhino Inquisitor
date: '2026-11-30T09:00:00Z'
lastmod: '2026-11-30T09:00:00Z'
description: >-
  Find out which cartridges, script hooks, jobs, and site preferences still live
  on the SFCC instance in Storefront Next and how each reaches the storefront.
author: Thomas Theunen
categories:
  - Salesforce Commerce Cloud
  - Technical
tags:
  - storefront next
  - sfcc
  - composable storefront
  - sfra
  - scapi
---
## Key Takeaways
- Explains which cartridges, script hooks, and jobs stay on the SFCC instance when you move to Storefront Next
- Shows how custom site preferences travel from Business Manager to the storefront through the MRT data store
- Gives a what-lives-where table for deciding if logic belongs in the React app or on the backend

You’ve moved a project to Storefront Next. The React app renders, the product pages load, and then someone in the team chat asks the awkward question: “Is our `calculate` hook still running, or did we just migrate it into the void?” Nobody is sure. Somebody remembers a cartridge that nobody wants to touch, and a nightly job that sends orders to the ERP. Do they still work? Where do they even live now?

The short answer: **the SFCC instance is still the backend**. Storefront Next is a separate frontend that talks to it over APIs. Most of what you built on the server side stays exactly where it is. This post walks through what stays, what is new, and how the bridge between the two works.

A few definitions first, because I’ll use them throughout:

-   **Cartridge:** SFCC’s packaging unit for code, templates, and metadata. A site only uses a cartridge if it is listed on that site’s **cartridge path**, an ordered list of cartridge names set in Business Manager.
-   **Script hook:** a function registered through `hooks.json` (the cartridge’s `package.json` points to it) that the platform calls at a defined extension point, for example when a basket is calculated.
-   **Job:** a scheduled or manually started process in Business Manager, built from job steps.
-   **Site preference:** a configurable value, defined as a custom attribute on the `SitePreferences` system object type and edited per site in Business Manager.
-   **SCAPI and OCAPI:** the Salesforce Commerce API and the older Open Commerce API. Both are HTTP APIs that expose shopper and admin data from the instance. Storefront Next calls SCAPI.
-   **MRT (Managed Runtime):** Salesforce’s hosting environment where the Storefront Next app runs, separate from the SFCC instance.

> **Scope:** This post covers the backend boundary. For the bigger picture of the move away from PWA Kit, see [Storefront Next: Architecture and the PWA Kit Migration](/storefront-next-architecture-and-migration-from-pwa-kit/).

## Two Halves, One Instance

The frontend has moved out of the instance; everything behind the API stays put. The storefront talks to SCAPI; SCAPI talks to the platform; the platform runs your cartridges, hooks, and jobs.

flowchart LR Shopper --> App\["Storefront Next\\n(React, on MRT)"\] App -->|SCAPI| Platform\["SFCC instance"\] Platform --> Hooks\["Script hooks\\n(cartridge code)"\] Platform --> Jobs\["Jobs and services"\] Platform --> Prefs\["Site preferences"\] Prefs -->|synced| Store\["MRT data store"\] Store --> App

Nothing about your Business Manager, your catalogue, your promotions, or your order management has moved. What went away, for every route Storefront Next serves, is the controller-and-ISML rendering layer (controllers handled requests, and ISML templates produced the HTML in SFRA). In a hybrid setup, routes you list in `legacyRoutes`, such as `/cart` and `/checkout`, still render through SFRA or SiteGenesis, per the [hybrid guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-hybrid.html). Everything that was never about rendering stays where it was, although how the storefront reaches it has changed.

## The `app_storefrontnext_base` Cartridge

The Storefront Next project carries one cartridge of its own: `cartridges/app_storefrontnext_base`. Per the [Page Designer deployment guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-pd-deploy-cartridge.html), its documented job is to carry the Page Designer metadata to the instance. You generate and deploy it with `pnpm cartridge:generate` and `pnpm cartridge:deploy`, and the GitHub setup action deploys it for you. Page Designer setup is a classic source of confusion (missing roles and scopes, plus a separate Local Dev cartridge that is a downloadable ZIP and not this one); the [Page Designer troubleshooting guide](/storefront-next-page-designer-troubleshooting-guide/) covers those.

Think of it as a metadata cartridge, not as a new SFRA. The generated output is JSON under `cartridge/experience/` (components, pages, aspects), and nothing I found describes it as holding hook scripts or controllers. Like any cartridge, it only counts once it is on the site’s cartridge path: the [Page Designer integration guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-page-designer.html) tells you to add `app_storefrontnext_base` under **Administration > Sites > Manage Sites > \[your site\] > Settings**. If you need server-side logic, that is what your own cartridges are for.

## Which Script Hooks Still Run

A hook is a function in your cartridge that the platform calls before or after an API operation, so you can validate, change, or extend what happens. Hooks keep running because SCAPI and OCAPI [share the same hooks](https://developer.salesforce.com/docs/commerce/sfnext/guide/extensibility_via_hooks.html). The storefront calls SCAPI, SCAPI fires the hook, and your cartridge code answers. That holds only for the Shopper APIs that support hooks: the docs list Shopper Experience, Shopper Payments, Shopper Custom Objects and Shopper Consents as having none, and a cached SCAPI response skips the hook until it expires. The docs note that hook names keep the historical `dw.ocapi.shop.*` prefix even when the caller is SCAPI, so an existing OCAPI hook needs no renaming. The mechanics haven’t changed, so I won’t repeat them here; [Using OCAPI and SCAPI Hooks in SFCC](/how-to-use-ocapi-scapi-hooks/) has the `hooks.json` details.

Three rules from the docs matter in practice:

-   **SCAPI needs a switch.** Hook execution for the Commerce APIs is enabled in Business Manager under Administration > Global Preferences > Feature Switches. If hooks silently don’t fire, check this before anything else.
-   **Names must match.** The exported function name must match the hook name without its package prefix. `sfcc.app.tax.calculate` exports `calculate`.
-   **Errors have consequences.** In a Shopper API hook, returning `Status.ERROR` rolls back and returns HTTP 400, and an uncaught exception returns HTTP 500. Commerce App extension points set their own rules, and `sfcc.app.tax.calculate` blocks on both.

### The Calculate Hook

“Calculating” a basket means recomputing its totals: product prices, promotions, shipping, and tax. `dw.order.calculate` is the extension point for that work, and it has a default implementation that you can override. The storefront never calls it directly. The platform runs it as a side effect of many basket and order operations, which is why it feels automatic. Server-side code can also call it explicitly, and the documented sample does so inside an `afterPUT` hook like this:

```js
var HookMgr = require('dw/system/HookMgr');
HookMgr.callHook('dw.order.calculate', 'calculate', basket);
```

The calling code passes the hook name, the function name, and the basket. Nothing else is needed.

Per the docs, if a Shopper API hook returns a value, it skips the system implementation of that hook and any hooks registered after it, and the docs recommend returning nothing so that important functions like the cart calculate hook still run. If your calculate hook is shared with controllers and opens its own transaction, that breaks SCAPI, so branch with `request.isSCAPI()` where the behaviour has to differ. And if your calculation comes from SFRA’s `app_storefront_base`, SiteGenesis, or a custom `dw.order.calculate` hook, it [can bypass the Commerce App extension points](https://developer.salesforce.com/docs/commerce/sfnext/guide/building-your-app.html). The documented fix is to call `TaxMgr.applyTax` and `ShippingMgr.applyShipping` from your `calculate.js` instead of calling the `dw.order.calculateTax` and `dw.order.calculateShipping` hooks directly. It only matters if you install a tax or shipping Commerce App, and the install-time warning doesn’t block installation.

> **Which script version does the calculate hook run?** Two hook names are in play. The [Script API reference for `CalculateHooks`](https://developer.salesforce.com/docs/commerce/b2c-commerce/references/b2c-script-api/dw.order.hooks.CalculateHooks.html) says the default `dw.order.calculate` implementation falls back to the older `dw.ocapi.shop.basket.calculate` hook, which is deprecated and writes to the deprecated API usage logs, and it tells you to override `dw.order.calculate` instead. So if your cartridge registers `dw.order.calculate`, that is the version that runs; if it only registers the old name, the default implementation calls that. Registered hooks run in cartridge-path order, so a second cartridge registering the same hook changes the outcome, and Commerce App tax providers sit outside that ordering. I found nothing that says Storefront Next picks a different script, but log from the hook on your own instance before you rely on it.

## Cartridges and Jobs Must Stay on the Path

Hooks and custom job steps are registered through cartridges (`hooks.json` and `steptypes.json`), and the code behind your services lives there too, so a cartridge only counts when it is on the site’s cartridge path (or the Business Manager site’s path, for organisation-level resources). Services (the wrappers SFCC uses for calls to external systems) are configured in Business Manager, but the code that calls them is not. The path is searched left to right, and for files the first match wins; the [cartridge path post](/sfcc-cartridge-path-overrides-explained/) shows what that means for overrides. Hooks are the exception: every module registered for an extension point runs, in cartridge-path order. All of this is general platform behaviour from the [Cartridges guide](https://developer.salesforce.com/docs/commerce/b2c-commerce/guide/b2c-cartridges.html), and the Storefront Next Page Designer guide still has you add `app_storefrontnext_base` to the path.

Don’t remove a cartridge because “the frontend is React now”. A job is configured in Business Manager, but any custom step it uses comes from a `steptypes.json` in a cartridge, so a nightly export built on custom steps stops working once that cartridge leaves the path or its code version is no longer active. The same goes for hooks, and for the code behind your services; the service configurations themselves stay in Business Manager.

If you plan to install a tax or shipping Commerce App, SFRA’s `app_storefront_base` and the SiteGenesis cartridges can bypass the Commerce App extension points, because their `calculate.js` calls the legacy hooks directly. The install shows a warning, which [doesn’t block installation](https://developer.salesforce.com/docs/commerce/sfnext/guide/building-your-app.html), and the documented fix is the `calculate.js` change above. The docs say outright that you don’t need to remove those cartridges from the path. I’d still test the change on a sandbox before touching production paths.

## How Site Preferences Reach the Storefront

Here is the most useful new bridge. The storefront doesn’t run on the instance, so it can’t call `Site.getCurrent().getCustomPreferenceValue()`. Instead, preferences are synced into the Managed Runtime (MRT) data store, and the app reads them from there. The [data store guide](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-data-store.html) describes the setup:

1.  Register `dataStoreMiddlewareLazy` in `src/root.tsx`, after `siteContextMiddleware`. Middleware is code that runs on every request before the page loader, and this one prepares the preference lookup. It must come after `siteContextMiddleware` because the site ID has to resolve first. The retail template already does this.
2.  Site preferences land under the key `<siteId>-custom-site-preferences`, and global ones under `custom-global-preferences`.
3.  In a loader (the React Router function that fetches data on the server for a route), call `getSitePreferencesLazy(context)` or `getCustomGlobalPreferencesLazy(context)`. Both return a promise of a key-value record, or `null` when the entry is missing, so add a fallback like `?? {}`.
4.  Pass the values to components through `useLoaderData`. There’s no client-side hook.

Sensitive values such as passwords are masked in the store and come back masked. A single preference can’t exceed 380 KiB, and larger values don’t sync. If the store is unreachable, `SFNEXT_DATA_STORE_UNAVAILABLE_MODE` defaults to `fallback` and returns an empty object, so set it to `throw` if you’d rather fail loudly. For local development, seed values with `MRT_DATA_STORE_DEFAULTS`.

### The Five-Minute Wait, and Its Replacement

Until October 2026, site preferences synced to Managed Runtime periodically, so a change could take several minutes to show up. The data store page says the sync is based on the B2C Target Info and Site IDs configured for your Managed Runtime environment, but it doesn’t name a job, and neither does anything else I found. Don’t confuse it with `sfcc-push-page-manifests`, which is the Page Designer manifest job and runs every five minutes on production after replication.

That delay is gone. The [MRT release notes](https://developer.salesforce.com/docs/commerce/sfnext/guide/sfnext-mrt-release-notes.html) say that since B2C Commerce 26.10 (enabled for all customers on 30 October 2026) preference changes reach the storefront shortly after you save them, with no action on your side. So if a preference still looks stale, I’d check the key name, the site ID, the middleware order, the 380 KiB limit, and the B2C Target Info and Site IDs on the environment before blaming the sync timing.

## What Lives Where

| Concern | Where it lives | How the storefront reaches it |
| --- | --- | --- |
| Rendering, routing, components | Storefront Next on MRT | Runs in the React app |
| Page Designer metadata | `app_storefrontnext_base` cartridge, plus page manifests built by the platform | Cartridge deployed to the instance; system jobs push the manifests to the MRT data store |
| Basket and order calculation | Default `dw.order.calculate` hook, that your cartridge can override | Triggered implicitly by SCAPI basket and order calls |
| Custom OCAPI/SCAPI hooks | Your cartridges | SCAPI, with hook execution enabled |
| Custom SCAPI endpoints | Custom API in your cartridge, on the site’s cartridge path | The storefront calls it like any other SCAPI endpoint |
| Scheduled jobs, services | Cartridges on the instance | Not called by the storefront; run by the platform, or called from hooks and custom APIs |
| Custom site preferences | Business Manager | MRT data store, read in loaders |
| Tax providers | Commerce App extension points | The platform calls the registered provider through the Extension Registry |

If a row feels ambiguous, ask one question: does it render something, or does it decide something every channel has to agree on? Rendering moved to React. Those decisions stayed behind the API, and the cartridge that holds that logic stays on the path.
