Skip to content

salesforcecommercecloud/storefront-next

v1.12.1Apache-2.0

Storefront Next development skills for building React 19 storefronts on Salesforce B2C Commerce.

sfnext-data-fetching

Load and mutate data in a Storefront Next project: route loaders that call SCAPI through createApiClients from @/lib/api-clients.server, critical versus streamed (deferred) data, createBasketAction and BasketAction for cart actions, createActionError and ErrorCode, data() responses, useFetcher and the useScapiFetcher hook with its server allowlist, request-scoped dedupe and MRT timeouts, non-personalized SCAPI responses, shopper context, and custom API clients. Use for "fetch products in a loader", "stream data", "add a cart action", "call SCAPI from a component", "resource route", "NormalizedApiError", or "loader blocks the page". Do not use for route files or links (use storefront-next:sfnext-routing), when loaders re-run after actions (use storefront-next:sfnext-revalidation), Suspense/LCP tuning (use storefront-next:sfnext-performance), or defining SCAPI custom APIs (use storefront-next:sfnext-scapi).

Read SKILL.md at the source

Pinned to revision fe78868e0e70, so it is the text this page describes rather than whatever the author pushed since.

Files

Every link opens the file at its source, pinned to the revision this page describes.