Skip to main content

Init options

These options are passed to initCheckout() (framework SDKs) or Commercengine.init() / new Checkout() (vanilla JS).

Credentials

Appearance

Authentication

Choosing the session ownerUse authMode: "provided" whenever the parent application imports @commercengine/storefront or makes direct session-bound Commerce Engine API calls. This applies even when the storefront has no custom login UI: the Storefront SDK still creates and refreshes the session used by cart, wishlist, account, and order operations.Use managed mode only when Hosted Checkout is the sole Commerce Engine integration—for example, a static or no-code site that does not use the Storefront SDK.

Quick Buy

Callbacks

Hosted Checkout uses @commercengine/analytics internally to map canonical Commerce Engine cart, coupon, checkout-step, payment, identity, and order events. onAnalyticsEvent exposes the completed envelopes without prescribing a destination. See Analytics for Hosted Checkout, custom SDK checkout, and direct REST patterns.

Managed in Checkout Studio

The following settings are configured remotely in Checkout Studio (Config API) and injected into checkout on each page load:
  • Feature flags (loyalty, coupons, collectInStore, freeShippingProgress, productRecommendations)
  • Login configuration (enabled methods, account switch behavior)
  • Drawer direction (mobile/desktop)
  • Payment provider selection
  • Brand appearance tokens (colors, typography, shape system, sizing)
These are intentionally not part of the SDK init options.

Configuration precedence (source of truth)


Methods

These methods are available on the checkout instance (vanilla JS) or returned by the framework hook/composable.

Runtime properties (vanilla JS)


Events

When using the vanilla JS SDK (@commercengine/js), you can listen to events with checkout.on(event, handler):
Hosted Checkout uses @commercengine/analytics internally. The same vendor-neutral mapper package can also be used by custom checkout implementations built with the Storefront SDK or direct REST calls. See Analytics. If your storefront already uses @commercengine/storefront, run Hosted Checkout in provided mode and wire token sync both ways:

Environment URLs

The SDK is hosted at https://cdn.commercengine.com/v1.js (single deployment). The environment option selects the hostname pattern, and storeId is encoded in the subdomain.