thirdweb: Create an NFT Marketplace with thirdweb and IPFS
Learn how to create an NFT marketplace with thirdweb and IPFS.
thirdweb is an easy-to-use platform to build Web3 applications with code or no-code. thirdweb makes creating and deploying apps such as NFT collections or NFT marketplaces easy. thirdweb can be used with objects stored on IPFS, so objects stored in a Filebase IPFS bucket can be seamlessly uploaded for use with a thirdweb app.
Read below to learn how to create an NFT marketplace with thirdweb and IPFS.
- Have some Mumbai testnet currency.
- Create a folder of images you’d like to use as NFT images to be sold on your marketplace.
- Have an IDE or text editor for making changes to snippets of code.



Then select 'Deploy Now'.

For this tutorial, we’ll be using the Mumbai testnet, so we are using a Mumbai wallet.

To do this, navigate to console.filebase.com. If you don’t have an account already, sign up, then log in.
Select ‘Create Bucket’ in the top right corner to create a new bucket for your NFTs.

Bucket names must be unique across all Filebase users, be between 3 and 63 characters long, and can contain only lowercase characters, numbers, and dashes.

These files need to be named in sequential order, such as 0.png, 1.png, 2.png, etc.


https://ipfs.filebase.io/ipfs/IPFS_CID
Take note of this URL.
Select the ‘Code’ tab. This code showcases different code snippets to use to mint your NFTs using scripts, with your contract address and crypto wallet address inputted automatically for easy copy and paste. This tutorial will showcase the JavaScript code examples, but you can use any of the languages showcased in this Code tab. You can follow along with the code examples showcased in this tutorial, or copy and paste the snippets provided in this tab.

npm install @thirdweb-dev/sdk
CONTRACT
with your contract address.WALLET_ADDRESS
with your crypto wallet address.- Each
IPFS_CID
with your IPFS folder CID you took note of earlier. - Replace the name and description of each NFT with your desired information.
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
const sdk = new ThirdwebSDK("mumbai");
const contract = sdk.getContract("CONTRACT", "nft-collection");
// Address of the wallet you want to mint the NFT to
const walletAddress = "WALLET_ADDRESS";
// Custom metadata of the NFTs you want to mint.
const metadatas = [{
name: "Cool NFT #1",
description: "This is a cool NFT",
image: fs.readFileSync("https://ipfs.filebase.io/ipfs/IPFS_CID/0.png"), // This can be an image url or file
}, {
name: "Cool NFT #2",
description: "This is a cool NFT",
image: fs.readFileSync("https://ipfs.filebase.io/ipfs/IPFS_CID/1.png"),
}];
const tx = await contract.mintBatchTo(walletAddress, metadatas);
const receipt = tx[0].receipt; // same transaction receipt for all minted NFTs
const firstTokenId = tx[0].id; // token id of the first minted NFT
const firstNFT = await tx[0].data(); // (optional) fetch details of the first minted NFT
You can edit this script to include as many NFTs as you’d like to mint at one time.
node mint.js



Then select 'Deploy Now'.

Then select the network you’d like to deploy your marketplace on. This tutorial will use the Polygon Mumbai testnet.
Then select 'Deploy Now'.



You will be prompted to authorize 2 transactions through your crypto wallet.


Then select ‘Copy to Clipboard’ to copy your embedded NFT marketplace widget code, which you can insert to any webpage to put your marketplace live so your NFTs can be purchased by others!

If you have any questions, please join our Discord server, or send us an email at [email protected]