Why use Hosted Checkout?
- Ship faster β skip building cart UI, payment forms, and checkout logic from scratch.
- Always up to date β new payment methods, UI improvements, and features are deployed automatically.
- PCI compliant β payment data never touches your servers.
- Framework agnostic β works with React, Vue, Svelte, Solid, or plain HTML.
- Zero layout shift β the iframe loads in the background with no impact on Core Web Vitals.
How it works
Install the SDK
Add
@commercengine/checkout via npm, or load @commercengine/js from the CDN. The SDK creates a hidden iframe pointing to the hosted checkout app.Initialize with your credentials
Call
initCheckout() (or Commercengine.init() for CDN) with your storeId and apiKey. The iframe loads in the background and emits a ready event when itβs prepared.Open the checkout
Call
openCart() or openCheckout() from a button click. A slide-over drawer appears with the full checkout experience β cart, login, address, payment, and confirmation.Packages
@commercengine/checkout
Drop-in universal SDK with first-class bindings for React, Vue, Svelte, and Solid.
@commercengine/js
Vanilla JavaScript SDK. Use directly via npm or load from the CDN at
cdn.commercengine.com/v1.js. No framework dependency.Pick your integration
React
useCheckout() hook with reactive state. No providers needed.Vue
useCheckout() composable returning reactive refs.Svelte
Readable stores with
$checkout syntax.Solid
Fine-grained signals via
useCheckout() primitive.Vanilla JS / CDN
Script tag or ES module import. No build step required.
Configuration
Full reference for all config options, events, and methods.