Usage
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 aref guard to prevent double-mounting in Strict Mode:
Related
Card Element
Embed a secure card input for custom payment flows
Server SDK - Checkout
Build headless checkout flows server-side