Bridge

Get Started

thirdweb Bridge allows developers to easily bridge and swap tokens between chains and wallets.

The quickest way to setup Bridge in your React app is with the SwapWidget component.

Live Playground

React

Swap Widget Playground

Try out the Swap Widget in our live playground

Installation

Install the thirdweb SDK in your React project:

npm i thirdweb

Create a Client

First, create a client file for reuse throughout your app:

// thirdwebClient.ts
import { createThirdwebClient } from "thirdweb";
export const client = createThirdwebClient({
clientId: "YOUR_CLIENT_ID", // Get from your thirdweb dashboard
});

Setup the Provider

Wrap your application with the ThirdwebProvider

// app.tsx / _app.tsx
import { ThirdwebProvider } from "thirdweb/react";
function App() {
return (
<ThirdwebProvider>
<YourApp />
</ThirdwebProvider>
);
}

Add Swap Widget

Use the SwapWidget to let users swap tokens

import { SwapWidget } from "thirdweb/react";
function Example() {
return <SwapWidget client={client} />;
}

Explore Full API References

For comprehensive guides on implementing the full thirdweb SDK, explore our language-specific documentation: