Skip to main content

Get the store

One call returns everything about the store, its products and categories included. init() starts loading it in the background, so by the time your code asks, it’s usually already there. Like every data call, it resolves rather than throws when something goes wrong - the only rejection is when there’s no store to ask for, which Installation covers. So check success before reading data:

The store object

Fields that aren’t set are left out rather than sent as null, so treat every optional field as possibly missing. The complete list is on the TypeScript page.

Products

store.products holds public products, and also unlisted and on-hold ones: Private products (2) are never sent. For a product grid, keep the public ones, in the merchant’s order:
Keep the unlisted ones for your cart page, though: someone with a direct link can put one in their cart, and the cart still needs its name and price. See Products for everything on a product.

Categories

A category lists its products by ID. Some of those IDs can belong to private products that aren’t in store.products, so look each one up and skip what you don’t find:

Logo and banner

Both resolve to a full image URL. When the merchant hasn’t uploaded one, you get a Komerza placeholder image rather than nothing. To leave the space empty instead, check the branding first:
branding.accentColor is the merchant’s brand color. The script’s own built-in UI uses it, and your storefront can too.

Policies and support

The merchant’s policy pages, when they’ve set them, belong in your footer:

Maintenance mode

When the merchant puts the store into maintenance mode, maintenanceReason holds their message. Show it in place of the shop:

Public statistics

Rough, rounded figures for social proof, if the merchant has turned on Public statistics under Online Store → Settings → General:
It always resolves with success: true. When the merchant hasn’t turned statistics on - or they can’t be loaded - the strings are empty and averageRating is null, so hide the section when totalOrders is empty.

Caching

The store, the banner URL and the currency formatter are cached in memory for five minutes, so calling getStore() from every component costs one request, not one each. Concurrent calls share the same request too. The cache lasts as long as the page: a reload fetches fresh data. getProduct() and getProductReviews() aren’t cached - each call is a request.

Next

Products

Variants, stock, subscriptions, volume pricing and reviews

Images

Turning image file names into URLs
Last modified on October 15, 2026