This guide is for the React SDK only
- restrict page access based on users NFTs or Tokens
- give user list of scopes based on users NFTs or Tokens
OR
statement. That allows you to create a complex logic based on AND
and OR
gates, as you’ll see in the example section on this page!
General Setup
Visit the Access Control tab of the Dynamic dashboard.- Click “Create new gate”
- Set a name for your gate
- Choose from two options:
- Allow Site Access - users who fulfils the criteria won’t be blocked from entering the site.
- Return scope - users who fulfils the criteria will have a scope added to their
jwt
token.
- Select chain on which you want to apply the gate. Right now we only allow adding gates for
Ethereum
,Polygon
,Optimism
,Arbitrum
. If you need another, let us know! - Select the type of criteria for the gate:
- Token - for token criteria you need to select a token you want for users to have and amount.
- NFT - for NFT criteria you need to enter contract address of NFT you want for users to have.
- Save and enable the toggle when you’re ready.
- Boom. You’re done!
Using our UI
When gates are enabled, the Dynamic Widget automatically blocks or annotates the user’s session according to your rules. No additional code is needed to enforce access or add scopes in the JWT.Using your UI
Use headless checks to read scopes and adjust your UI. See scope examples below.Examples
Block site for users without specific amount of tokens. Gate setup:- User needs to have at least 1 SHIB to enter the site.

- User is blocked in Dynamic Widget:

- User needs to have specific NFT to have
admin
scope

- User has an
admin
scope added to thejwt
json
Working with scopes
Use the
useDynamicScopes
hook to check user scopes and conditionally render content.React