Skip to main content

useNFTCollection() function

Warning: This API is now obsolete.

This hook is deprecated and will be removed in a future major version. You should use instead.

- const nftCollection = await sdk.useNFTCollection("0x1234...");
+ const nftCollection = await sdk.useContract("0x1234...", "nft-collection").contract;

Hook for getting an instance of an NFTCollection contract. This contract is meant to interface with ERC721 compliant NFTs.


import { useNFTCollection } from '@thirdweb-dev/react'

export default function Component() {
const nftCollection = useNFTCollection("<YOUR-CONTRACT-ADDRESS>")

// Now you can use the nftCollection contract in the rest of the component

// For example, this function will return all the NFTs on this contract
async function getNFTs() {
const nfts = await nftCollection.getAll()
return nfts



export declare function useNFTCollection(
contractAddress: RequiredParam<string>,
): import("@thirdweb-dev/sdk").NFTCollection | undefined;


contractAddressRequiredParam<string>the address of the NFT Collection contract, found in your thirdweb dashboard


import("@thirdweb-dev/sdk").NFTCollection | undefined