Skip to main content
The Checkout Widget renders a buy-now button directly in your page. When clicked, it opens Henry’s hosted checkout modal where the buyer completes payment, address, and order confirmation. Henry handles everything - you supply the product links and listen for events.

Usage

Add a container in your HTML:

Options

widgetId string *required

Your Widget ID from the Henry Dashboard.

items CartItem[] *required

One or more products to include in the checkout. Each item requires a link (a direct product page URL) and optionally accepts:

display object

Controls how the widget is rendered.

display.size

display.theme


settings CartSettings

Optional settings that control checkout behavior, service fees, and event triggers.

settings.options

settings.serviceFeeFixed

Add a fixed service fee to every checkout.

settings.serviceFeePercent

Add a percentage-based service fee (0–100).

settings.events

Fire webhooks or send emails on order state changes.

Events

Use .on() to subscribe to checkout events and .off() to remove a listener.

checkout-complete

Fires when the buyer successfully completes checkout.

checkout-closed

Fires when the checkout modal closes, either by the buyer or programmatically.

Methods

.on(event, callback)this

Subscribe to a checkout event. Returns the element instance for chaining.

.off(event, callback)this

Remove a previously registered listener.

.destroy()

Unmount the widget and clean up all event listeners. Call this when navigating away or unmounting a component.

TypeScript


React

Use a ref guard to prevent double-mounting in Strict Mode:

Card Element

Embed a secure card input for custom payment flows

Server SDK - Checkout

Build headless checkout flows server-side