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:

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,
});

Example

Browser example with ethers v6 and browser wallet (e.g. MetaMask):

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(),
});

Hierarchy (view full)

Accessors

Constructors

Properties

The configuration for the LensClient