Deleting Content

This guide will walk you through deleting content on the Lens Storage Nodes.


For deleting files or folders link_hash addressing is used.

  • If a link_hash resolves to a folder, all containing files will be deleted including the folder.

  • If it resolves to a file, only the single file will be deleted.

Assuming you have a signer instance that satisfies the Signer interface.

interface Signer {  signMessage({ message }): Promise<string>;}

Viem's WalletClient class satisfies the Signer interface.

Then, simply delete the resource (file or entire folder) using its lens:// URI as follows:

let success = await storageClient.delete("lens://af5225b…", signer);
console.log(success); // true

That's it—you successfully deleted the resource from the Lens Storage Nodes.