Documentation Index
Fetch the complete documentation index at: https://www.commercengine.io/docs/llms.txt
Use this file to discover all available pages before exploring further.
NPM Package
@commercengine/js
Vanilla JavaScript SDK. Use directly via npm or load from the CDN at
cdn.commercengine.com/v1.js. No framework dependency.CDN (recommended for static sites)
Add the script tag to your HTML and initialize when it loads:The
async attribute on the script tag is important. It ensures the SDK loads without blocking page rendering. The Commercengine.onLoad callback fires once the script is ready.The SDK resolves hosted checkout to store-specific subdomains from
storeId + environment. Feature flags, login methods, drawer direction, and payment provider are managed in Checkout Studio (Config API), not in SDK init options.ES Module import
If you’re using a bundler (Vite, Webpack, etc.) but don’t want framework bindings:Add to cart
Programmatically add items from product pages:null as the variant ID for products without variants: