Skip to main content
You can add Hyperlane bridging directly into your site so users never have to leave your app. The @hyperlane-xyz/warp-widget SDK handles iframe creation, theming, and event listening.

Install

React

Vanilla JS

Works with Vue, Angular, Svelte, or plain HTML — anything that can give you a DOM element.
Returns { iframe, destroy, on }iframe is the raw HTMLIFrameElement, destroy() removes it and cleans up listeners, on(event, callback) subscribes to events and returns an unsubscribe function.

Theme Colors

Control the widget’s look by passing a theme object. All color values are hex strings without the # prefix.
Setting mode: 'dark' applies a full dark color scheme. You can still override individual colors on top — for example, mode: 'dark' with accent: '22c55e' gives a dark widget with green accents.

Transfer Defaults

Pre-fill the transfer form so users land on a ready-to-go state instead of picking chains and tokens themselves.

Route Filtering

By default the widget shows all routes from the Hyperlane registry. To limit which routes your users see, pass their IDs:
Route IDs are derived from the Hyperlane Registry deployments — the folder name is the symbol and the config file name is the route identifier. For example, deployments/warp_routes/USDC/eclipsemainnet-config.yaml becomes USDC/eclipsemainnet. Only specified routes will appear in the token selector.

Events

The widget sends events to your app. Use onEvent in React or widget.on() in vanilla JS.

Self-Hosting

The widget points to the Hyperlane-hosted Warp UI by default. If you fork and deploy the Warp UI template yourself, the /embed route is included automatically. To restrict which sites can embed your instance, set the NEXT_PUBLIC_EMBED_ALLOWED_ORIGINS environment variable:
If not set, any site can embed the widget (default: *). Set this in production to prevent unauthorized sites from embedding your instance.

Alternative: No-Code Embed

If you can’t install npm packages (e.g. WordPress, Shopify, Webflow), you can embed the widget with a plain iframe:
All theme properties work as URL params, plus origin, destination, originToken, destinationToken, and routes (comma-separated).

Troubleshooting

Widget doesn’t load

Your site’s Content Security Policy might be blocking the iframe. Add the Warp UI origin to your CSP frame-src:

Wallet popups don’t open

The iframe needs allow-popups in its sandbox for wallet extensions like MetaMask. The SDK sets this automatically — if using a raw iframe, make sure your sandbox attribute includes it.

Examples

Working examples in the hyperlane-monorepo:
  • vanilla/ — Single HTML file, no build tools. Open in a browser.
  • react-app/ — Vite + React app showing both the React component and imperative API.