Skip to main content
This guide walks through the most common setup: embedding the Checkout Widget on a product page. If you’re collecting card details for a custom payment flow, jump to the Card Element guide instead.

Prerequisites

  • A Widget ID from the Henry Dashboard
  • A product URL (any publicly accessible product page)

Setup

1

Install the SDK

Or load via CDN - no build step required:
When loaded via CDN, use window.Henry instead of the ES module import.
2

Add a container element

3

Mount the Checkout Widget


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.
See Checkout Widget for the full list of display sizes and what each looks like.

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 a ref 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