Bridge

Checkout widget iframe

The Checkout widget iframe makes it easy to accept crypto and fiat payments in your app. Just add an iframe to your HTML and get a fully customizable checkout widget - no build setup required.

Features

  • Accept payments in crypto or fiat (credit/debit cards)
  • Cross-chain payment support across 85+ blockchains
  • Display product information (name, description, image)
  • Dark and light mode support
  • Display fiat values in multiple currencies

Iframe Integration

The checkout widget requires below minimum parameters to be set:

  • chain - The chain ID where you want to receive payment (e.g., 8453 for Base)
  • tokenAddress (optional) - The token address to accept as payment. If this parameter is not set, payment will be accepted in the native token of the specified chain.
  • amount - The amount to charge (as a decimal string, e.g., "0.01")
  • seller - The wallet address that will receive the payment

Example

Accept 0.1 USDC on Base as payment to seller (0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024)

<iframe
src="https://thirdweb.com/bridge/checkout-widget?chain=8453&tokenAddress=0x833589fcd6edb6e08f4c7c32d4f71b54bda02913&amount=0.1&seller=0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024"
height="700px"
width="100%"
style="border: 0;"
/>

Try it out

Checkout Widget Playground

Try out the Checkout Widget in our live playground

Options

You can customize the checkout widget using query parameters as mentioned below.

Theme

By default the widget uses the "dark" theme. You can set the light theme by passing the theme=light query parameter.

<iframe
src="https://thirdweb.com/bridge/checkout-widget?chain=8453&amount=0.01&seller=0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024&theme=light"
height="700px"
width="100%"
style="border: 0;"
/>

Product Information

You can display product information by passing title, description, and image query parameters. Each of these parameters are optional.

Make sure to URI encode the parameters if they contain special characters

Currency

By default the fiat value of the token amounts is displayed in USD. You can change the currency by setting the currency query parameter.

Example

Show fiat values in Euro (EUR) in the widget.

<iframe
src="https://thirdweb.com/bridge/checkout-widget?chain=8453&amount=0.01&seller=0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024&currency=EUR"
height="700px"
width="100%"
style="border: 0;"
/>

thirdweb branding

By default, the widget displays thirdweb branding at the bottom. You can hide this by setting the showThirdwebBranding query parameter to false.

<iframe
src="https://thirdweb.com/bridge/checkout-widget?chain=8453&amount=0.01&seller=0xdd99b75f095d0c4d5112aCe938e4e6ed962fb024&showThirdwebBranding=false"
height="700px"
width="100%"
style="border: 0;"
/>

Listening for Events

The checkout widget iframe sends events to the parent window using postMessage when a purchase succeeds or fails.

You can listen for these events to handle the purchase result in your application.

window.addEventListener("message", (event) => {
// verify that message is from thirdweb checkout widget iframe
if (
event.origin === "https://thirdweb.com" &&
event.data.source === "checkout-widget"
) {
if (event.data.type === "success") {
console.log("Purchase successful!");
}
if (event.data.type === "error") {
console.error(
"Purchase failed with error:",
event.data.message,
);
}
}
});