Embedded checkout keeps customers on your site. Instead of redirecting to a hosted payment page, Spaire renders the checkout as an overlay or inline frame directly in your UI. There are two ways to set it up: a no-code HTML snippet you can drop into any page, and a JavaScript library for React and other framework-based apps.Documentation Index
Fetch the complete documentation index at: https://docs.spairehq.com/llms.txt
Use this file to discover all available pages before exploring further.
HTML snippet
The quickest option. Works on any website or CMS that lets you insert HTML.- Create a checkout link
- Open the link’s settings and click Copy Embed Code
data-spaire-checkout attribute.
Change data-spaire-checkout-theme to "dark" for the dark variant.
JavaScript library
For React and other component-based apps, import the library instead of adding a<script> tag.
SpaireEmbedCheckout and call init() to attach handlers to all elements with data-spaire-checkout:
Programmatic control
For full control — opening checkout on custom triggers, handling events, managing the lifecycle — useSpaireEmbedCheckout.create() directly.
Open and listen for events
Close programmatically
React example with full lifecycle
Using a checkout session URL
Instead of a checkout link, you can pass a dynamically created checkout session URL from your backend. This lets you pre-fill customer data, set metadata, and customize the flow server-side.When using an embedded checkout with a session URL, you must set the
embed_origin parameter when creating the session. Set it to the origin of the page hosting the checkout — e.g., https://example.com. Without this, the iframe will be blocked for security reasons.Apple Pay and Google Pay
Wallet payment methods work automatically in hosted checkout (non-embedded). In embedded mode, your domain must be manually verified before wallet payments are enabled. To enable Apple Pay or Google Pay for your embedded checkout, email support@spairehq.com with your organization slug and the domain you’re embedding on.What’s next
Checkout Sessions
Create sessions from your backend for pre-filled, metadata-rich checkout flows.
Localized Checkout
Serve checkout in your customer’s language across 10 supported locales.

