Prerequisites
- A Widget ID from the Henry Dashboard
- A product URL (any publicly accessible product page)
Setup
Install the SDK
When loaded via CDN, use
window.Henry instead of the ES module import.End-to-end walkthrough
Step 1 - Mount the widget
createCheckoutElement takes a CSS selector (or DOM element) and an options object. Henry renders the widget inside your container immediately.
Step 2 - Listen for checkout events
Use.on() to respond when the buyer completes or closes checkout:
Step 3 - Clean up
Call.destroy() when the widget is no longer needed to unmount it and remove all listeners:
React
Use aref guard to prevent double-mounting in React Strict Mode:
Next steps
Checkout Widget
All display modes, settings, and events for the checkout widget
Card Element
Embed a secure card input for custom payment flows