Skip to main content
The Storefront SDK is the script behind every Komerza storefront. Put it on a page you’ve built yourself - plain HTML, React, Vue, Svelte, anything that runs in a browser - and it gives you the store’s products, a cart that survives reloads, and a checkout that hands the buyer to Komerza’s hosted payment page. It’s one script tag and a global 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:
Three habits in there are worth keeping whatever else you change:
  • Prices go through createFormatter(). Never print variant.cost yourself - on a store with adaptive currency the formatter converts it. See Currency formatting.
  • Text goes in with textContent, not innerHTML. 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 reports stock: 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?

Never put an API key in a storefront. Everything in the page is readable by every visitor, and the client library doesn’t need one.

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
Last modified on October 15, 2026