Skip to content

jasonsprouse/nextjs-lit-token-gating

 
 

Repository files navigation

Vercel

This is a minimal example of how to token-gate a VR Next.js page using Lit Protocol, getServerSideProps and aframe-react to render a VR scene.

This token gates a /protected page checking to see if the user has a Good Faith Paradigm ERC1155 token #490643.

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: '0xd07dc4262BCDbf85190C01c996b4C06a461d2430',
    standardContractType: 'ERC1155',
    chain: 'ethereum',
    method: 'balanceOf',
    parameters: [
      ':userAddress',
      '490643'
    ],
    returnValueTest: {
      comparator: '>',
      value: '0'
    }
  }
]
  1. Start the app
npm run dev

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 71.4%
  • CSS 28.6%