Skip to content

Minimal example of token gating with Next.js and Lit Protocol

Notifications You must be signed in to change notification settings

dabit3/nextjs-lit-token-gating

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a minimal example of how to token-gate a Next.js page using Lit Protocol using getServerSideProps.

This token gates a /protected page checking to see if the user has a Devs for Revolution ERC721 token.

To run this example:

  1. Clone the repo and install dependencies
git clone git@github.com:dabit3/nextjs-lit-token-gating.git

cd nextjs-lit-token-gating

npm install
  1. Update the accessControlConditions with the contract address of the NFT you'd like to use:
const accessControlConditions = [
  {
    contractAddress: '0x25ed58c027921E14D86380eA2646E3a1B5C55A8b',
    standardContractType: 'ERC721',
    chain: 'ethereum',
    method: 'balanceOf',
    parameters: [
      ':userAddress'
    ],
    returnValueTest: {
      comparator: '>',
      value: '0'
    }
  }
]
  1. Start the app
npm run dev

About

Minimal example of token gating with Next.js and Lit Protocol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published