Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A Next.js example demonstrating how to read smart contract data from EVM blockchains using server-side rendering and SWR revalidation.
Web3 Data Fetching is a Next.js example from Vercel's curated examples collection that demonstrates reading smart contract data from Ethereum Virtual Machine (EVM) blockchains via view functions that require no gas fees.
Web3 Data Fetching is a documentation-focused example project built with Next.js and Tailwind CSS. It accepts a smart contract's address and ABI as input and renders the contract's view-function results in a web page, either server-side or client-side. The example is maintained by Vercel in the vercel/examples GitHub repository and has a live demo at https://web3-data-fetching.vercel.app/. The demo shows how to instantiate a connection to a smart contract, retrieve its information server-side, and retrieve it again using SWR for revalidation.
pnpm create-next-app with the example URL to bootstrap the project locally, then pnpm dev to run it in development mode.Clone the example with pnpm create-next-app --example https://github.com/vercel/examples/tree/main/solutions/web3-data-fetching, then run pnpm dev to start the development server. To deploy, you can use the one-click Vercel deployment button or push the repository to Vercel using the standard Next.js deployment flow.
