komerza object. There’s no API key and nothing to run on a
server.
What you get
- Store and products - name, branding, categories, products, variants, prices, stock and reviews
- A cart - add, remove and change quantities, kept in the visitor’s browser across reloads and tabs
- Checkout - creates the order and sends the buyer to Komerza’s hosted checkout to pay
- Prices - a formatter in the store’s currency, or the shopper’s own if the store uses adaptive currency
- The rest, without code - the cookie notice, pop-up offers, recent-order notifications, analytics and affiliate links. See Built-in features
Quick example
A complete page that lists the store’s products and keeps a cart count:- Prices go through
createFormatter(). Never printvariant.costyourself - on a store with adaptive currency the formatter converts it. See Currency formatting. - Text goes in with
textContent, notinnerHTML. Product names come from the merchant, but reviews are written by customers, and any of it rendered as HTML can run script on your page. - Availability comes from
isOutOfStock. When a merchant hides stock levels, every variant reportsstock: 0, so reading that as “sold out” makes the whole store unbuyable.
Where it runs
On Komerza. Build locally and deploy with the Komerza CLI:komerza deploy
builds your project and puts it live at your store’s URL. The build has to produce static HTML,
CSS and JavaScript - server-side rendering at request time isn’t supported.
Anywhere else. Host the page wherever you like and call komerza.init("your-store-id"). If
your site sends a Content-Security-Policy, allow the origins listed in
Built-in features.
Client library or API?
Next
Installation
Load the script and initialize it, including in React, Vue and Svelte
Products
Variants, stock, subscriptions, volume pricing and reviews
Basket
The cart, and keeping your UI in step with it
Checkout
Creating the order, and handling what can go wrong