Lens Protocol Client with token-gated content support.
It provides access to all the core Core.LensClient modules and the Gated module.
NodeJS example:
import { Wallet } from 'ethers';import { production } from '@lens-protocol/client';import { LensClient } from '@lens-protocol/client/gated';const signer = new Wallet(process.env.PRIVATE_KEY);const client = new LensClient({ environment: production, authentication: { domain: process.env.DOMAIN, uri: process.env.URI, }, signer,}); Copy
import { Wallet } from 'ethers';import { production } from '@lens-protocol/client';import { LensClient } from '@lens-protocol/client/gated';const signer = new Wallet(process.env.PRIVATE_KEY);const client = new LensClient({ environment: production, authentication: { domain: process.env.DOMAIN, uri: process.env.URI, }, signer,});
Browser example with ethers v6 and browser wallet (e.g. MetaMask):
ethers
import { BrowserProvider } from 'ethers';import { production } from '@lens-protocol/client';import { LensClient } from '@lens-protocol/client/gated';const provider = new BrowserProvider(window.ethereum);const client = new LensClient({ environment: production, authentication: { domain: window.location.hostname, uri: window.location.href, }, signer: await provider.getSigner(),}); Copy
import { BrowserProvider } from 'ethers';import { production } from '@lens-protocol/client';import { LensClient } from '@lens-protocol/client/gated';const provider = new BrowserProvider(window.ethereum);const client = new LensClient({ environment: production, authentication: { domain: window.location.hostname, uri: window.location.href, }, signer: await provider.getSigner(),});
The authentication module
The Explore module
The Feed module
The Frames module
The Gated module
The Handle module
The Invites module
The Modules module
The Momoka module
The Nfts module
The Notifications module
The Profile module
The Publication module
The Revenue module
The Search module
The Transaction module
The Wallet module
Readonly
The configuration for the LensClient
Lens Protocol Client with token-gated content support.
It provides access to all the core Core.LensClient modules and the Gated module.
Example
NodeJS example:
Example
Browser example with
ethers
v6 and browser wallet (e.g. MetaMask):