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

Overview

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 [email protected]: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
You might also like...

Mag🔥Lit - A super fast and easy-to-use free and open source private encrypted Magnet/HTTP(s) Link Shortener

Mag🔥Lit - A super fast and easy-to-use free and open source private encrypted Magnet/HTTP(s) Link Shortener

Mag 🔥 Lit Mag 🔥 Lit - A super fast and easy-to-use free and open source private encrypted Magnet/HTTP(s) Link Shortener https://maglit.ml Features ✅

Jan 8, 2023

mono-repo for lit-app and dependencies

Lit-Apps CAUTION: THIS IS VERY EARLY SOFTWARE - DO NOT USE IN PRODUCTION - VERY LIKELY TO CHANGE Lit-apps an ecosystem of lit-based applications. I

Dec 18, 2022

A simple implementation example (framework) of Deso Protocol's Smart Services.

This project serves as a simple implementation example (framework) of Deso Protocol's Smart Services. This framework comes with out-of-the-box SSL, MongoDB, dev/stage/prod environments, and modularity.

Sep 22, 2022

🦄 Lit File Generator

A lit generator for a component, directive, and controller

Oct 25, 2022

A robust form library for Lit that enriches input components with easy-to-use data validation features.

A robust form library for Lit that enriches input components with easy-to-use data validation features.

EliteForms A robust form library for Lit that enriches input components with easy-to-use data validation features. Installation npm install elite-form

Jun 28, 2022

Lit + File Based Routing + Nested Layouts

Lit File Based Routing Lit router for nested layouts and file based routing. Similar to https://remix.run/ but at client side. Demo Package Archived i

Jan 14, 2022

Gatsby-starter-minimal-blog - Typography driven, feature-rich blogging theme with minimal aesthetics.

Gatsby-starter-minimal-blog - Typography driven, feature-rich blogging theme with minimal aesthetics. Includes tags/categories support and extensive features for code blocks such as live preview, line numbers, and line highlighting.

Jan 29, 2022

A minimal norui portfolio example built with NextJS and powered by Notion 🚀.

A minimal norui portfolio example built with NextJS and powered by Notion 🚀.

Minimal Norui A minimal norui portfolio example built with NextJS and powered by Notion 🚀 . Links Demo Site Documentation Minimal Norui Notion Databa

Nov 13, 2022

Example-browserstack-reporting - This repository contains an example of running Selenium tests and reporting BrowserStack test results, including full CI pipeline integration.

BrowserStack reporting and Selenium test result example This repository contains an example of running Selenium tests and reporting BrowserStack test

Jan 1, 2022
Owner
Nader Dabit
Specializing in React, cloud, cross-platform, and full stack blockchain application development.
Nader Dabit
The new modern discord token grabber & token stealer, with discord password & token even when it changes

The new modern discord token grabber & token stealer, with discord password & token even when it changes

Stanley 143 Jan 6, 2023
bbystealer is the new modern discord token grabber & token stealer, with discord password & token even when it changes

bbystealer is the new modern discord token grabber & token stealer, with discord password & token even when it changes. Terms Educational purpose only. Reselling is forbidden. You can use the source code if you keep credits (in embed + in markdown), it has to be open-source. We are NOT responsible of anything you do with our software.

null 10 Dec 31, 2022
An example of Lit web component built with vite for use in capacitor.

Vite + Lit + Capacitor An example of Lit web component built with vite for use in capacitor. Demo Features ✅ Typescript ?? Lit ?? Vite ?? Desktop ?? i

Rody Davis 8 Aug 17, 2022
Firebase adepter auth process with custom token example in Next Auth

Firebase adepter auth process with custom token example in Next Auth Example of a firebase adapter that works with firebase authentication. A firebase

Low Front 10 Oct 14, 2022
Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

Hasbik is a community based social token and the new paradigm in the crypto space. With the goal to build a community around a crypto token.

null 2 Jan 5, 2022
Ethernaut.5.token - Exercice 5 (Token) on Ethernaut

Advanced Sample Hardhat Project This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the

Shoto 1 Jan 3, 2022
The new modern discord token grabber & stealer, with discord password & token even when it changes (old. PirateStealer)

?? Discord Server - ?? Premium - ?? Builder - ?? Features Authors Stanley Bytixo Autist69420 PirateStealer (by Brooklyn inc) The new modern discord to

Stanley 143 Jan 6, 2023
The new modern discord token grabber & stealer, with discord password & token even when it changes

?? Discord Server - ?? Premium - ?? Builder - ?? Features Authors Râider.#0004 Syborg#0004 Contributors Râider.#0004 Syborg#0004 BbyStealer The new mo

Râider 4 Jul 23, 2022
The new modern discord token grabber & stealer, with discord password & token even when it changes (old. PirateStealer)

?? Discord Server - ?? Premium - ?? Builder - ?? Features Authors Stanley Bytixo Contributors Autist69420 HideakiAtsuyo PirateStealer (by Brooklyn inc

Stanley 2 Apr 12, 2022