Docs

Getting Started

You can get started by creating a new project or adding thirdweb to an existing project.

Existing Projects

Install the thirdweb packages in your project

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

And follow the framework specific instructions below.

New Projects

Create a new project using the thirdweb CLI

npx thirdweb create app

Wrap your application in ThirdwebProvider

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

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

const App = () => {
  return (
    <ThirdwebProvider activeChain="ethereum" clientId="your-client-id">
      <YourApp />
    </ThirdwebProvider>
  );
};

With the provider set up, all of the SDK’s hooks and components work out of the box!

Now you can connect to the user’s 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>
  );
};