Introducing the BridgeWidget Script

Introducing the BridgeWidget Script

The BridgeWidget Script makes it easy to embed cross-chain swaps and fiat onramp UI into your app. Just add a script tag to your HTML and get a fully customizable widget — no build setup required.

BridgeWidget UI

Key Features

  • Cross-chain token swaps across 80+ blockchains
  • Fiat onramp support to buy tokens with credit/debit cards
  • Customizable UI — use prebuilt themes or override with your brand colors
  • Prefill token selections for a smoother user experience
  • Display fiat values in multiple currencies
  • Event callbacks to track user actions (success, error, cancel, disconnect)

Example

<!-- Add this script in <head> -->
<script src="https://unpkg.com/thirdweb/dist/scripts/bridge-widget.js"></script>

<!-- Add a container element where you want to render the UI -->
<div id="bridge-widget-container"></div>

<!-- Initialize the widget at the end of <body> -->
<script>
  const container = document.querySelector('#bridge-widget-container');

  BridgeWidget.render(container, { 
    clientId: "your-thirdweb-client-id",
    theme: "dark",
    buy: {
      chainId: 8453,
      amount: "0.1",
    },
  });
</script>

Learn More

View Documentation