Skip to main content

Documentation Index

Fetch the complete documentation index at: https://na-36-handover-docs-v2-into-docs-v2-dev-20260518.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Token-gated video combines Lit Protocol’s decentralised access control with Livepeer’s JWT playback policy. A viewer proves NFT ownership to Lit; Lit returns a signed JWT; the Livepeer Player presents the JWT to the CDN edge for access. What you will build: A React application where only holders of a specific NFT contract can play a Livepeer-hosted video.

Token-gating architecture

Viewer wallet → Lit Network (ownership check) → Signed JWT → Livepeer CDN (JWT verified) → Video playback
Three systems interact:
  • Lit Protocol — verifies on-chain conditions (NFT ownership) and issues access control conditions (ACCs) that gate a symmetric encryption key or a signed payload
  • Livepeer-compatible gateway — creates a JWT-protected asset and provides a signing key
  • Playback gateway or CDN — validates the JWT on every playback request at the edge

Prerequisites

  • Node.js 18 or later
  • A deployed NFT contract (ERC-721) on Ethereum mainnet or any supported chain
  • A gateway provider API key or self-hosted gateway with JWT playback access control enabled
  • Familiarity with React and ethers.js or wagmi
npm install livepeer @livepeer/react @lit-protocol/lit-node-client ethers

Build the gate

Extending the gate

The access control conditions accept any Lit-supported chain and condition type:

AI agent prompt

Build the "Token-gate videos with Lit Protocol" tutorial as a React/TypeScript app. Create a project that installs livepeer, @livepeer/react, @lit-protocol/lit-node-client, ethers, wagmi, and the wallet connector dependencies needed by wagmi. Use placeholders for LIVEPEER_API_URL=<gateway asset API base URL>, LIVEPEER_API_KEY=<gateway provider API key>, NEXT_PUBLIC_PLAYBACK_BASE_URL=<provider playback base URL>, NEXT_PUBLIC_ACCESS_CONTROL_PUBLIC_KEY=<Livepeer signing key public ID>, LIVEPEER_ACCESS_CONTROL_PRIVATE_KEY=<private signing key>, NFT_CONTRACT_ADDRESS=<ERC-721 contract>, and CHAIN=<Lit-supported chain>. Implement server-side signing-key and JWT helpers, Lit access-control conditions for ERC-721 ownership, a wallet-gated React player, and a README with exact run and verification steps. Do not use Livepeer Studio keys or hardcoded livepeercdn.studio URLs.

Access Control

JWT and webhook-based access control without Lit Protocol.

IPFS Video Integration

Store video on IPFS and deliver via Livepeer.
Last modified on May 19, 2026