Skip to main content
The Fungies JavaScript SDK provides a programmatic way to open checkout experiences in your web application.

Installation

Initialization

Opening Checkout

Overlay Mode

Opens checkout in a full-screen modal overlay:

Embed Mode

Renders checkout inside a target DOM element:

Checkout Options

Billing Data Object

Prefill customer billing information:

Multi-Product Checkout

Specify quantities for multiple offers:

Custom Fields

Pass custom field values to the checkout:

Closing Checkout

Programmatically close the checkout:

Listening to checkout events

The SDK listens for messages from the checkout iframe and dispatches DOM events on document. This happens automatically when you call Fungies.Initialize() or use the data-auto-init script attribute — no extra setup is required. Use these events to run your own logic after a purchase (redirect to a thank-you page, refresh entitlements, show a confirmation modal, etc.). Import event name constants from the package (recommended):
With the CDN script tag, register listeners after the SDK loads:
In React, attach listeners in a useEffect and remove them on unmount:

DOM Scanning

If you dynamically add checkout buttons after page load, trigger a manual scan:

Complete Example