π β± Ready to build? Get early access now!β± π
Mint an NFT Collection with TypeScript
Mint your own NFT using thirdweb TypeScript SDK
Intro
This guide explains in 4 easy steps how to mint an NFT. Minting an NFT requires a couple of steps. We need to create a project in the dashboard and create an NFT Collection module inside our project. We also need to connect a wallet. So if you don't have a wallet, make sure to sign up with MetaMask or CoinWallet. Here's our guide on how to create a Metamask Wallet.
Alright without further ado, let's mint an NFT.
Dashboard setup
The first thing we need to do is head over to the dashboard and create a project and an NFT Collection module. if you don't know how to do this, check out this guide.
Once the module is created, it's time to mint our first NFT, but we don't need the dashboard for that! I mean we could, but why use GUI if we can use Typescript!?

The code
1. Create a Typescript file
Go ahead and create a new TypeScript file. Let's call it index.ts
and open it in your favorite code editor. We'll use Visual Studio Code.

Next up use we'll install the ThirdWeb SDK using npm!
2. SDK installation and setup with TypeScript
- @3rdweb/sdk - thirdweb TypeScript SDK.
- ethers - will give us very useful utils.
- dotenv - to hide our private key.
- typescript - since this is a TypeScript project
- @types/node - typing for node as a dev dependency.
- tslib - utility package
npm init -y npm install @3rdweb/sdk ethers dotenv npm install --save-dev typescript @types/node ts-node tslib
In order to make use of our SDK, you need to establish a connection to a blockchain. Click here to learn how to connect to the blockchain and instantiate our SDK.
For this guide, you will need to instantiate the SDK following these steps, using your own signer with thirdweb.
3. Define which module to use
Now we need to define which module we want to use. This is the module we just created inside our project Minting NFTs with JavaScript/TypeScript. We called the module 'TypeScript'. This module has an address. We need to pass the address here. You can find the address here, under TypeScript:
In our index.ts
we include the following code. First we define a variable nft_smart_contract_address
and store our module address in here.
Then we create an object that uses the NFT Collection module inside the sdk with our address.

// assign the smart contract address nft_smart_contract_address = "0xD9bC403529471515F16DA32eee652c0a6cEcBA78"; // Instantiate NFT Collection module const nft = sdk.getNFTModule(nft_smart_contract_address);
4. Time to mint the NFT!
The arguments passed over here are the same as minting an NFT inside the dashboard. If you want to familiarize yourself with the process, check out the dashboard!
// Minting the NFT asynchronously async function mint() { console.log( await nft.mint({ name: "Hi π", description: "If you are interested in...follow meβ ", image: "ipfs://QmbGpe6dJQA9awBbTKEULufp9TTjXw1esVUbZNQrLM57nK", properties: {}, }), ); } // Running the entire thing mint();
# Runs the TypeScript file npx ts-node index.ts
That's it!
You have minted your own NFT using thirdweb and the TypeScript SDK, you should be proud!