thirdweb: Build an NFT Minting Page with thirdweb, IPFS, RainbowKit, and WAGMI
Learn how to build an NFT minting page with thirdweb, IPFS, RainbowKit & WAGMI.
What is thirdweb?
1. Start by navigating to the thirdweb dashboard and connecting your crypto wallet.

2. Select ‘Deploy New Contract':

3. Under 'NFTs', select ‘NFT Collection’:


4. Give your NFT collection a name, icon, and description, then confirm that the recipient address is your crypto wallet address.

5. Select ‘Deploy Now’ and confirm the transaction through your crypto wallet.

6. Next, we need to create an IPFS bucket on Filebase.
7. Select ‘Buckets’ from the left sidebar menu, or navigate to console.filebase.com/buckets.

8. Enter a bucket name and choose the IPFS storage network to create the bucket.

9. Now, upload your NFTs to Filebase using the web console and selecting ‘Folder’, then select the folder that contains your NFT files.
10. You will see your folder uploaded as a single object:

11. Copy the CID of your folder:

12. Navigate to your IPFS Folder using the Filebase IPFS gateway to see your folder’s files:
13. Head back to the thirdweb dashboard, where you will see the page for your NFT collection.

14. Open a command line window and install the thirdweb SDK:
15. Open an IDE such as VSCode and insert the following code, replacing the following values:
16. Save this script as mint.js, then run this script with the command:
mint.js, then run this script with the command:17. Refresh your thirdweb dashboard. Your NFTs will be listed.

18. You will need the NFT collection’s contract address later, so copy the contract address as shown here:

19. Next, open a new terminal window. Start a new Vite project with the command:

20. Then, navigate into the project’s directory and install the required dependencies:
21. Your app’s location will be returned. Navigate to the listed IP address to view your default application:


22. Next, open a new terminal tab or window, make sure you are in your project’s directory, then install the Rainbowkit and Wagmi packages, along with a few other dependencies:
23. Open the src/main.tsx file in your IDE of choice. Replace the existing content with the following:
src/main.tsx file in your IDE of choice. Replace the existing content with the following:24. Next, open the src/App.tsx file and replace the existing content with the following:
src/App.tsx file and replace the existing content with the following:25. Your react app will update automatically every time you save a file. At this stage, it should look like this:

26. Create a new file in the src directory called abiFile.json with the following content:
src directory called abiFile.json with the following content:27. Now it’s time to create a function that will get the URL for our NFT’s image. To do this, open the src/App.tsx file again and replace the content we added before with the following:
src/App.tsx file again and replace the content we added before with the following:28. At this point, your app will look like this:

29. Now let’s add the function to mint an NFT. Update your src/App.tsx file to reflect the following:
src/App.tsx file to reflect the following:30. Now your app will look like this:

31. Connect your wallet, then select ‘Mint’ to mint your NFT!

Previousthirdweb: Build an NFT Loot Box with thirdweb and IPFSNextthirdweb: Create a Discord Bot That Gives Roles to NFT Holders
Last updated