Learn how to enable users to access certain features only if they have a Farcaster account or a combination of Farcaster + other criteria such as a specific POAP or NFT.
๐ช Token Gating
Airstack provides easy-to-use APIs for enriching Farcaster applications and for integrating onchain and offchain data with Farcaster.
Table Of Contents
In this guide you will learn how to use Airstack to:
If the length of the data.TokenBalances.TokenBalance array is 0, then it implies that the user has no given NFT held.
Otherwise, the user have at least one of the given NFT and then can have the owner.socials to be checked further to confirm if the user has any Farcaster.
If owner.socials has length 0, then similarly the user has no Farcaster.
Otherwise, the user has Farcaster and can be given access to a the desired feature.
Gating only user(s) that have Farcaster and POAP
You can implement token gating by checking whether users have both Farcaster and the given POAP:
If the length of the data.Poaps.Poap array is 0, then it implies that the user has no given POAP held.
Otherwise, the user have at least one of the given POAP and then can have the owner.socials to be checked further to confirm if the user has any Farcaster.
If owner.socials has length 0, then similarly the user has no Farcaster.
Otherwise, the user has Farcaster and can be given access to a the desired feature.
Developer Support
If you have any questions or need help regarding token gating, please join our Airstack's Telegram group.