Build a tokengated storefront
You can use tokengating to create exclusive access and unlockable discounts for your customer segments. Whether you want to reward your most loyal customers or another brand's token holders, this tutorial shows you how to create end-to-end tokengating experiences with Headless and Hydrogen storefronts.
What you'll learnAnchor link to section titled "What you'll learn"
In this tutorial series, you'll learn how to use the Gates API to read gates on products, use a connected crypto wallet to check wallet contents against gates, and react accordingly. The end result is an end-to-end gated customer experience that applies discounts to the cart automatically using Shopify Functions.
Before you start this tutorial, you first need to create gates using the Gates API, and build Shopify Function that applies a gated discount. Refer to the following tutorials for more information:
Tutorial seriesAnchor link to section titled "Tutorial series"
Follow the tutorial series to go from a Hydrogen template to a tokengated buying experience.
Tutorial 1: Get started
Install and configure blockchain packages, create gates and attach them to products.
Tutorial 2: Save a connected wallet to session storage
Handle connection events from the
@shopify/connect-wallet package and store the connected wallet in cookies.
Tutorial 3: Read and evaluate gates
Use the stored wallet and your product's gates to evaluate if a customer satisfies the requirements for the gate.