Comprehensive tutorial on how to automatically follow all Farcaster users who own specific NFTs like CryptoPunks. Learn to build Web3 social features by combining Farcaster social graphs with NFT ownership data using Neynar’s powerful APIs.
This guide demonstrates how to follow Farcaster users who own a specific NFT.Check out this Getting started guide to learn how to set up your environment and get an API key.Before all that, initialize Neynar client:
Javascript
Copy
Ask AI
// npm i @neynar/nodejs-sdkimport { NeynarAPIClient, Configuration } from "@neynar/nodejs-sdk";// make sure to set your NEYNAR_API_KEY .env// don't have an API key yet? get one at neynar.comconst config = new Configuration({ apiKey:process.env.NEYNAR_API_KEY,});const client = new NeynarAPIClient(config);const signer = process.env.NEYNAR_SIGNER;
First, we need to get the addresses owning Milady. We can use the Alchemy NFT API to get the addresses of users who own the NFT.