useNFTs

Hook to query all NFTs associated with a smart contract.

Available to use on smart contracts that implement the ERC721 or ERC1155 standard.

NFT metadata is automatically fetched from where the tokenUri is hosted (e.g. IPFS), and makes the image property available as a URL through our IPFS gateway (if the image is hosted on IPFS).

By default, only returns the first 100 NFTs in the collection. You can use the queryParams argument to filter the NFTs that are returned or to paginate through the collection.

Example

import { useNFTs, useContract } from "@thirdweb-dev/react";
function App() {
const { contract } = useContract(contractAddress);
const { data, isLoading, error } = useNFTs(contract);
}

Parameters

Returns

Query result object that includes an array of NFT objects