Gettings Started
This guide will help you get started with the Lens Storage Nodes.
TypeScript
You can interact with the Lens Storage Nodes via the @lens-protocol/storage-node-client library.
Then, instantiate the client with the following code:
import { StorageClient, testnet } from "@lens-protocol/storage-node-client";
const storageClient = StorageClient.create(testnet);
That's it—you are now ready to use its methods.
const obj = { key: "value" };
const { uri } = await storageClient.uploadAsJson(obj);
console.log(uri); // "lens://4b2e..."
API
You can also interact with the Lens Storage Nodes by means of a RESTful API.
Network | URL | |
---|---|---|
Testnet | https://storage-api.testnet.lens.dev | |
Mainnet | Coming soon |
In the following guides we will show you how to interact with these API using cURL commands.