Hosted Shoppex storefronts use ThemeDocuments, not this SDK. Start at Themes for hosted theme work.
Package names
Use@shoppexio/storefront in browser and 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: ThemeDocument plus the platform commerce runtime
What the 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 stays saved 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.
Install the SDK
Use the CDN build for the fastest start, with one script tag and no build step. Use npm instead if you have a bundler and want TypeScript types.Initialize and run your first request
After you load the SDK, initialize it with your store slug.string
required
Your store’s unique identifier. Find this in your Shoppex dashboard under Settings.
string
default:"en"
Default language for the SDK. Affects price formatting and checkout language.
string
Override the store’s default currency. Must be a valid ISO 4217 currency code.
TypeScript and browser support
The SDK includes TypeScript definitions. Import types directly.Internet Explorer is not supported. The SDK uses modern JavaScript features such as Promises, async/await, and ES6+ syntax.
Use the Developer 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