This SDK is for custom browser/headless storefronts. Hosted Shoppex themes use Liquid and the platform commerce runtime. Start at Liquid Theme Development for hosted theme work.
CDN (Recommended)
Fastest way to get started — one script tag, no build step. Use npm instead if you have a bundler and want TypeScript types.
< script src = "https://cdn.shoppex.io/sdk/v0.3/shoppex.umd.js" ></ script >
For ESM imports without npm, load the module build directly:
< script type = "module" >
import shoppex from 'https://cdn.shoppex.io/sdk/v0.3/shoppex.esm.js' ;
shoppex . init ( 'your-store' );
</ script >
Use @shoppexio/storefront for browser/headless storefront code. Use @shoppexio/sdk only from trusted backend code.
npm / yarn / pnpm
Install the SDK as a dependency:
npm install @shoppexio/storefront
Then import and use:
import shoppex from '@shoppexio/storefront' ;
shoppex . init ( 'your-store' );
Initialization
After loading the SDK, initialize it with your store slug:
shoppex . init ( 'your-store' , {
locale: 'en' , // Optional: default language
currency: 'USD' , // Optional: default currency
});
Your store’s unique identifier. Find this in your Shoppex dashboard under Settings.
Default language for the SDK. Affects price formatting and checkout language.
Override the store’s default currency. Must be a valid ISO 4217 currency code.
Verify Installation
Check if the SDK is loaded and initialized:
// Check if SDK is loaded
if ( typeof shoppex !== 'undefined' ) {
console . log ( 'SDK loaded' );
}
// Check if SDK is initialized
if ( shoppex . isInitialized ()) {
console . log ( 'SDK initialized for:' , shoppex . getConfig (). storeSlug );
}
TypeScript Support
The SDK includes TypeScript definitions. Import types directly:
import shoppex , {
type Product ,
type CartItem ,
type ShoppexConfig
} from '@shoppexio/storefront' ;
Browser Support
The SDK supports all modern browsers:
Browser Minimum Version Chrome 60+ Firefox 55+ Safari 12+ Edge 79+
Internet Explorer is not supported. The SDK uses modern JavaScript features like Promises, async/await, and ES6+ syntax.
Next Steps
Quick Start Fetch products and build a cart in under 5 minutes.
Store API Load store metadata, products, and groups.