Unlock Guides

Back

Token Gating with Unlock

“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.

PlatformDetails
DiscordMultiple custom bots including Guild and Collab.land
ParagraphNative in platform (video walkthrough and docs)
Guild.xyzNative in platform
CharmVerseNative in platform
Huddle01Native in platform
TelegramGuide
Huddle01Guide
NotionGuide
DarkBlockGuide
React applicationsTutorial
Scaffold-ethTutorial
Express.jsTutorial
Web pagesTutorial
Other applicationsAny 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.

Was this article helpful?
YesNo

Table of Contents