Skip to main content
Loaders fetch store data server-side and render it through a child function. Prefetch on the server with PrefetchedLoaders, then render with the matching loader component. The client reads the seeded cache, so the first paint has data and no loading state.

loaders/collection-loader

@replohq/sdk/loaders/collection-loader
Fetch a Shopify collection by handle or collection GID from Storefront API. Cached for: 60s Exports

loaders/collection-products-loader

@replohq/sdk/loaders/collection-products-loader
Fetch products for a Shopify collection from Storefront API with cursor pagination. Each product includes per-variant availability, price, compareAtPrice, sku, image, and options/optionValues so collection cards can render variant pickers, sold-out states, and strike-through pricing without a per-product fan-out. Always present on the result: id, handle, title, availableForSale, featuredImage, minPrice, maxPrice, compareAtMinPrice, compareAtMaxPrice, options, variants Cached for: 60s Exports

loaders/contentful-entries-loader

@replohq/sdk/loaders/contentful-entries-loader
Fetch one page of published entries for a Contentful content type from the Delivery API (limit 1–100, default 100; use skip for further pages). Linked entries/assets resolve into includes. Response includes total/skip/limit. Cached for: 60s Exports

loaders/contentful-entry-loader

@replohq/sdk/loaders/contentful-entry-loader
Fetch a single published Contentful entry by ID from the Delivery API, with linked entries/assets resolved into includes. Cached for: 60s Exports

loaders/judgeme-review-aggregate-loader

@replohq/sdk/loaders/judgeme-review-aggregate-loader
Fetch aggregate review stats (average score, total reviews, star distribution) for a product from Judge.me. Cached for: 60s Exports

loaders/judgeme-reviews-loader

@replohq/sdk/loaders/judgeme-reviews-loader
Fetch published reviews for a product from the Judge.me Reviews API. Cached for: 60s Exports

loaders/levanta-product-loader

@replohq/sdk/loaders/levanta-product-loader
Fetch a Levanta product by ASIN with affiliate link data. Cached for: 60s Exports

loaders/loox-review-aggregate-loader

@replohq/sdk/loaders/loox-review-aggregate-loader
Fetch review aggregate (average rating, total count, 1-5 star distribution) for a Shopify product from the Loox Storefront API. Cached for: 60s Exports

loaders/loox-reviews-loader

@replohq/sdk/loaders/loox-reviews-loader
Fetch published reviews (including photo/video media) for a Shopify product from the Loox Storefront API. Cached for: 60s Exports

loaders/metaobject-loader

@replohq/sdk/loaders/metaobject-loader
Fetch a single Shopify metaobject entry by type + handle (or by id) from the Storefront API. Use for reusable structured content a merchant models as a metaobject — size charts, ingredient lists, care instructions. Discover types first with shopify_metaobject_definitions_list. IMPORTANT: this only returns entries whose DEFINITION has storefront access PUBLIC_READ, which is NOT the default — check storefrontAccess before building a page around one, or the page will render empty. Cached for: 300s Exports

loaders/metaobjects-loader

@replohq/sdk/loaders/metaobjects-loader
Fetch Shopify metaobject entries of one type from the Storefront API with cursor pagination. Same storefront-access caveat as shopify_storefront.metaobject. Entries whose definition has the publishable capability are only returned once ACTIVE, so drafts will be missing. Cached for: 300s Exports

loaders/okendo-review-aggregate-loader

@replohq/sdk/loaders/okendo-review-aggregate-loader
Fetch review aggregate (average rating, count, star distribution) for a Shopify product. Cached for: 60s Exports

loaders/okendo-reviews-loader

@replohq/sdk/loaders/okendo-reviews-loader
Fetch published reviews for a Shopify product from the Okendo Storefront API. Cached for: 60s Exports

loaders/product-loader

@replohq/sdk/loaders/product-loader Serves Replo Products and Shopify. Set loaderKey to choose the source.
Replo Products Fetch a single Replo product by UUID from the Replo database. Cached for: 60s Shopify Fetch a Shopify product by handle or product GID from Storefront API. Cached for: 60s Exports

loaders/rebuy-recommendations-loader

@replohq/sdk/loaders/rebuy-recommendations-loader
Fetch AI-powered product recommendations from Rebuy for given Shopify product IDs. Always present on the result: id, images Cached for: 60s Exports

loaders/reviews-io-review-aggregate-loader

@replohq/sdk/loaders/reviews-io-review-aggregate-loader
Fetch aggregate review stats (average score and total reviews) for a product from Reviews.io. Cached for: 60s Exports

loaders/reviews-io-reviews-loader

@replohq/sdk/loaders/reviews-io-reviews-loader
Fetch published product reviews from the Reviews.io product review API. Cached for: 60s Exports

loaders/smile-earning-rules-loader

@replohq/sdk/loaders/smile-earning-rules-loader
Fetch all enabled earning rules (ways to earn points). Cached for: 300s Exports

loaders/smile-rewards-loader

@replohq/sdk/loaders/smile-rewards-loader
Fetch the rewards catalog (points products). Cached for: 300s Exports

loaders/smile-vip-tiers-loader

@replohq/sdk/loaders/smile-vip-tiers-loader
Fetch all VIP tier definitions with thresholds and colors. Cached for: 300s Exports

loaders/statsig-experiment-loader

@replohq/sdk/loaders/statsig-experiment-loader
Server-side evaluate a Statsig experiment for a visitor (by stable ID) and return the assigned variant group and its parameter values, so a page can render the correct variant during SSR without a flash of the original content. Cached for: 0s Exports

loaders/yotpo-review-aggregate-loader

@replohq/sdk/loaders/yotpo-review-aggregate-loader
Fetch aggregate review stats (average score, total reviews, star distribution) for a product from the public Yotpo widget API. Cached for: 60s Exports

loaders/yotpo-reviews-loader

@replohq/sdk/loaders/yotpo-reviews-loader
Fetch published reviews for a product from the public Yotpo widget API. Cached for: 60s Exports

loaders/prefetch-loaders

@replohq/sdk/loaders/prefetch-loaders

PrefetchedLoaders

Server component that prefetches one or more loader queries and seeds the React Query cache via HydrationBoundary. Client components that use useSuspenseQuery with the same queryKey will get the data immediately in the initial HTML — no loading state on first paint. The queryKey is derived internally as [loaderKey, args], matching the convention used by all loader components. Usage:

loaders/invoke-loader-server

@replohq/sdk/loaders/invoke-loader-server

invokeLoaderServer

Server-only loader invocation that calls the canopy-api gateway directly. Used by PrefetchedLoaders to seed the React Query cache during SSR. Results are cached via Next.js unstable_cache so repeated SSR renders for the same loader+args return instantly without a network round-trip to canopy-api. The canopy-api’s own in-memory cache still acts as a second layer for cold starts and cross-instance sharing.

loaders/loader-keys

@replohq/sdk/loaders/loader-keys

DATA_LOADER_KEYS

Shared data-loader key constants. Loader components and prefetch queries import from here so the strings are never duplicated across a generated site. These keys serve double duty: they identify which backend loader to invoke AND are used as React Query cache key prefixes. Loader components internally construct queryKey as [loaderKey, args]. Naming convention: <integration>.<objectType> or <integration>.<objectType>_<qualifier>.
Also exported

loaders/loader-schemas

@replohq/sdk/loaders/loader-schemas Exports

loaders/product-loader-args

@replohq/sdk/loaders/product-loader-args

buildProductLoaderArgs

Builds the single object used as BOTH the React Query key and the loader payload. They must stay identical: PrefetchedLoaders seeds the cache under [loaderKey, args], so an arg sent to the loader but missing from the key (or vice versa) silently misses the prefetch — the client refetches without it and the page renders incomplete data instead of erroring. Keys left undefined drop out of React Query’s key hash, so omitting a field here hashes the same as a prefetch that never passed it.
Also exported

loaders/collection-loader-args

@replohq/sdk/loaders/collection-loader-args

buildCollectionLoaderArgs

Builds the single object used as BOTH the React Query key and the loader payload. They must stay identical: PrefetchedLoaders seeds the cache under [loaderKey, args], so an arg sent to the loader but missing from the key (or vice versa) silently misses the prefetch. Keys left undefined drop out of React Query’s key hash, so omitting a field here hashes the same as a prefetch that never passed it.
Also exported

loaders/collection-products-loader-args

@replohq/sdk/loaders/collection-products-loader-args

buildCollectionProductsLoaderArgs

Builds the single object used as BOTH the React Query key and the loader payload. They must stay identical: PrefetchedLoaders seeds the cache under [loaderKey, args], so an arg sent to the loader but missing from the key (or vice versa) silently misses the prefetch. Keys left undefined drop out of React Query’s key hash, so omitting a field here hashes the same as a prefetch that never passed it.
Also exported