Lens JavaScript SDK
The official framework-agnostic JavaScript SDK for Lens Protocol.
This package enables you to interact with the Lens API via a type safe interface that abstracts away some of the GraphQL intricacies.
Documentation
Quick start
Install the Lens React Native SDK package using your package manager of choice:
Package Manager | Command |
---|
npm | npm install @lens-protocol/client@latest |
yarn | yarn add @lens-protocol/client@latest |
pnpm | pnpm add @lens-protocol/client@latest |
Development configuration example:
import { LensClient, development } from '@lens-protocol/client';
const client = new LensClient({
environment: development,
});
Production configuration example:
import { LensClient, production } from '@lens-protocol/client';
const client = new LensClient({
environment: production,
});
In a browser-based implementation you can use the Web Storage API to persist authentication state.
const client = new LensClient({
environment: production,
storage: window.localStorage,
});