Skip to main content

Storefront SDK

The Storefront SDK is for custom storefronts outside the Shoppex hosted theme runtime. Use it when you build your own customer-facing surface, for example:
  • a Next.js or Astro storefront
  • a plain HTML embed on an existing site
  • a React Native app with a small web checkout handoff
  • a SaaS app that sells add-ons from its own UI
Do not use this page as the new hosted theme guide. Hosted Shoppex storefront themes are Liquid packages. Start at Liquid Theme Development for theme work.

Package Names

Use @shoppexio/storefront in browser/headless storefront code. Use @shoppexio/sdk only on trusted servers that call the Developer API. Simple example:
  • Browser product grid: @shoppexio/storefront
  • Backend order automation: @shoppexio/sdk
  • Hosted Shoppex theme: Liquid templates plus platform commerce runtime

What The Storefront SDK Does

Public Catalog Reads

Fetch store metadata, products, groups, reviews, and listing data from public storefront endpoints.

Browser Cart State

Add, update, and remove cart items. Cart data persists locally in the browser.

Hosted Checkout Handoff

Create a checkout handoff and redirect customers to Shoppex hosted checkout.

Framework Neutral

Works with React, Vue, Svelte, Astro, plain HTML, or any browser runtime.

Quick Example

<script src="https://cdn.shoppex.io/sdk/v0.3/shoppex.umd.js"></script>
<script>
  shoppex.init('your-store');

  const response = await shoppex.getStorefront();
  const products = response.data.products;

  products.forEach((product) => {
    console.log(product.title, product.cdn_image_url);
  });

  shoppex.addToCart('product-id', 'variant-id', 1);
  await shoppex.checkout();
</script>

Use The Dev API For Server Work

The Storefront SDK is browser-safe and public. It does not replace the Developer API. Use the Developer API from your server when you need to:
  • create catalog-backed orders
  • manage customers
  • validate licenses
  • fulfill orders
  • manage webhooks
  • read private operational data
Never ship a secret shx_... API key in browser code.

Next Steps

Installation

Add the SDK via CDN or npm.

Quick Start

Build your first embedded storefront.

Liquid Theme Development

Build the Shoppex-hosted theme surface.

Developer API SDKs

Use @shoppexio/sdk from trusted backend code.