- 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!
How to create a new gate?
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!
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 SDK:

jwt
when having specific NFT
Gate setup:
- User needs to have specific NFT to have
admin
scope

- User has an
admin
scope added to thejwt
json
Working with scopes
To simplify working with scopes, we created a custom hook nameduseDynamicScopes
. It allows checking for users scopes and checking if one or many of them are in users jwt
token. Check the docs here.