“Token gating” is the ability to restrict access to content (e.g. articles, videos, sections of websites, etc.) to holders of a particular NFT. There are an ever-growing selection of onchain platforms that support token gating via Unlock Protocol as shown by the table below.
Most platforms that have native support for token gating implement it by way of seeing if a visitor holds a token from a particular smart contract. Typically, this means that the address of the smart contract is entered into an admin screen on the platform (this varies by platform), and then the platform does a technical check (using a smart contract function called balanceOf
) to see if the site visitor holds a token from that smart contract. The balanceOf
function typically returns the equivalent of a “true” result (if the holder does have a valid token/membership) or “false” if they do not.
There are a variety of implementations that vary a bit by platform.
Additionally, custom implementations are possible as well, as shown in the table below.
Platform | Details |
Discord | Multiple custom bots including Guild and Collab.land |
Paragraph | Native in platform (video walkthrough and docs) |
Guild.xyz | Native in platform |
CharmVerse | Native in platform |
Huddle01 | Native in platform |
Telegram | Guide |
Huddle01 | Guide |
Notion | Guide |
DarkBlock | Guide |
React applications | Tutorial |
Scaffold-eth | Tutorial |
Express.js | Tutorial |
Web pages | Tutorial |
Other applications | Any that support calls to balanceOf |
If you have any questions about token gating a particular application or platform with Unlock Protocol, please reach out in the Discord.