Skip to main content

Getting Started

To get started, install the required dependencies into your React project.

npm install @thirdweb-dev/react @thirdweb-dev/sdk @ethers^5

Wrap your application in the ThirdwebProvider component to start using the SDK.

import { ThirdwebProvider } from "@thirdweb-dev/react";

const App = () => {
return (
<ThirdwebProvider activeChain="ethereum">
<YourApp />
</ThirdwebProvider>
);
};

Examples of where to set this up: Create React App Next.js Vite


With the provider set up, all of the SDKs hooks and components work out of the box!

Now you can connect to the users wallet and start calling functions on your smart contracts like so:

import { Web3Button } from "@thirdweb-dev/react";

const Home = () => {
return (
<Web3Button
contractAddress={"{{contract_address}}"}
action={async (contract) => contract.call("myFunctionName")}
>
Call myFunctionName from the connected wallet
</Web3Button>
);
};