Skip to main content

Example Code

JS SDK Examples​

Gating dynamic and interactive content inside a React app​

This example code shows how to lock an entire React app behind a Lit JWT.

https://github.com/LIT-Protocol/lit-locked-react-app-minimal-example

Minimal JWT verification example to gate dynamic content on a server​

This repo is a minimal example to:

  • Mint an NFT (client side)
  • Provision access to a resource (a web url) behind ownership of that NFT (client side)
  • Request a signed JWT from the Lit network to access that resource (client side)
  • Verify the signature on that JWT (server side)

https://github.com/LIT-Protocol/lit-minimal-jwt-example

Minting HTML NFTs​

An example that showcases the ability to mint an HTML NFT with locked content that only the NFT owner can decrypt or see.

https://github.com/LIT-Protocol/MintLIT

Using the Lit JS SDK entirely serverside​

This shows how to use the Lit JS SDK to provision access to a resource, and then request access to it, entirely on the server side.

https://github.com/LIT-Protocol/lit-only-serverside-sdk-example

To see examples that utilize the Lit JS SDK, please visit the JS SDK examples page.

Other Examples​