Learn how to build an Allow List for your Farcaster Frames based on various criterias by using the Airstack Frames SDK.
You can limit access to your Farcaster Frame to only certain users that fulfill a requirement by creating an allow list based on certain criteria.
Get Started
First, install the Airstack Frog Recipes:
npminstall@airstack/froghono
yarnadd@airstack/froghono
pnpminstall@airstack/froghono
buninstall@airstack/froghono
Create A Custom Allow List
You can create an allow list that checks various onchain data easily using the createAllowList function. Some of the parameters that you can add to the allow list are:
Name
Type
Description
numberOfFollowersOnFarcaster
number
Check If the number of Farcaster followers greater than or equal to the given number.
isFollowingOnFarcaster
number[]
Check if the given FIDs are being followed by a Farcaster user.
Once you have the criteria set, the function will help you check whether all the criterias are fulfilled.
By default, it will only return true for Farcaster users that satisfy ALL the given requirements. However, if you would like to check your user with a different logic, you can provide an optional custom isAllowedFunction:
import { checkIsFollowingFarcasterUser, CheckIsFollowingFarcasterUserInput, CheckIsFollowingFarcasterUserOutput,} from"@airstack/frames";constinput:CheckIsFollowingFarcasterUserInput= { fid:3,// The creator of frame isFollowing: [99],// The fid of user interacting with your frames};const { data,error }:CheckIsFollowingFarcasterUserOutput=awaitcheckIsFollowingFarcasterUser(input);if (error) thrownewError(error);console.log(data);
[{ "fid":99,"isFollowing":true }]
Check If Farcaster User Has Casted In A Given Channel
You can check if Farcaster user has casted in a given channel by using the FarcasterChannelParticipants API and providing:
the "cast" value to the $channelActions variable,
the channel ID (e.g. /farcaster channel ID is "farcaster") to $channelId variable, and
If you have any questions or need help building an allow list for your Farcaster Frames using the Airstack Frames SDK, please join our Airstack's Telegram group.