Help & Support

Manage Apps

This guide explains how to manage Apps on Lens.

Update App Metadata

To update the metadata of an existing app, follow these steps.

You MUST be authenticated as Builder and be owner or admin of the App to update its metadata.

1

Create New App Metadata

First, construct an App Metadata object with the new content.

Use the @lens-protocol/metadata package to construct a valid AppMetadata object:

Example
import { MetadataAttributeType, app } from "@lens-protocol/metadata";
const metadata = app({  name: "XYZ",  tagline: "The next big thing",  description: "An app to rule them all",  logo: "lens://4f91cab87ab5e4f5066f878b72…",  developer: "John Doe <[email protected]>",  url: "https://example.com",  termsOfService: "https://example.com/terms",  privacyPolicy: "https://example.com/privacy",  platforms: ["web", "ios", "android"],});

2

Upload App Metadata

Next, upload the App Metadata object to a public URI.

import { storageClient } from "./storage-client";
const { uri } = await storageClient.uploadAsJson(metadata);
console.log(uri); // e.g., lens://4f91ca…

This example uses Lens Storage to host the Metadata object. See the Lens Metadata Standards guide for more information on hosting Metadata objects.

3

Update New Custom App Metadata

Next, update the app metadata using setAppMetadata action.

Example
import { uri, evmAddress } from "@lens-protocol/client";import { setAppMetadata } from "@lens-protocol/client/actions";
// …
const result = await setAppMetadata(sessionClient, {  metadataUri: uri("lens://4f91…"), // the URI with new metadata  app: evmAddress('0x1234…')});

4

Handle Result

Finally, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await setAppMetadata(sessionClient, {  metadataUri: uri("lens://4f91…"),  app: evmAddress("0x1234…")}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Update App Feeds

To update the custom feeds of an existing app, follow these steps.

You MUST be authenticated as Builder and be owner or admin of the App to update its feeds.

1

Update the App Feeds

First, update the custom feeds in an app using addAppFeeds or removeAppFeeds actions.

import { evmAddress } from "@lens-protocol/client";import { addAppFeeds } from "@lens-protocol/client/actions";
// …
const result = await addAppFeeds(sessionClient, {  feeds: [evmAddress('0x4546…')],  app: evmAddress('0x1234…')});

2

Handle Result

Then, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await addAppFeeds(sessionClient, {  feeds: ['0x4567…']  app: evmAddress("0x1234…")}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Set App Default Feed

To set the default feed for an app, follow these steps.

You MUST be authenticated as Builder and be owner or admin of the App to set its default feed.

1

Update App Default Feed

First, use setDefaultAppFeed action to set the default feed of an app.

import { evmAddress } from "@lens-protocol/client";import { setDefaultAppFeed } from "@lens-protocol/client/actions";
// …
const result = await setDefaultAppFeed(sessionClient, {  feed: { custom: evmAddress('0x4546…') },  app: evmAddress('0x1234…')});

2

Handle Result

Then, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await setDefaultAppFeed(sessionClient, {  feeds: { global: true },  app: evmAddress("0x1234…")}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Update App Graph

To update the graph of an existing app, follow these steps.

You MUST be authenticated as Builder and be owner or admin of the App to update its graph.

1

Set New Custom App Graph

First, use setAppGraph action to update or set the graph of an existing app.

import { evmAddress } from "@lens-protocol/client";import { setAppGraph } from "@lens-protocol/client/actions";
// …
const result = await setAppGraph(sessionClient, {  graph: { custom: evmAddress('0x1234…') },  app: evmAddress('0x1234…')});

2

Handle Result

Then, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await setAppGraph(sessionClient, {  graph: { globalGraph: true },  app: evmAddress("0x1234…")}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

App Treasury

To update the treasury of an existing app, follow these steps.

You MUST be authenticated as Builder and be owner or admin of the App to update its treasury.

1

Update App Treasury

First, use setAppTreasury action to update or set the treasury of an existing app.

Example
import { evmAddress } from "@lens-protocol/client";import { setAppTreasury } from "@lens-protocol/client/actions";
// …
const result = await setAppTreasury(sessionClient, {  treasury: evmAddress('0x4567…')  app: evmAddress('0x1234…')});

2

Handle Result

Then, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await setAppTreasury(sessionClient, {  treasury: evmAddress("0x4567…"),  app: evmAddress("0x1234…")}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

App Sponsorship

To update the sponsorship of an existing app, follow these steps.

You MUST be authenticated as Builder and be owner or admin of the App to update its sponsorship.

1

Update App Sponsorship

First, use setAppSponsorship action to update or set the sponsorship of an existing app.

Example
import { evmAddress } from "@lens-protocol/client";import { setAppSponsorship } from "@lens-protocol/client/actions";
// …
const result = await setAppSponsorship(sessionClient, {  treasury: evmAddress('0x4567…'),  app: evmAddress('0x1234…')});

2

Handle Result

Then, handle the result using the adapter for the library of your choice:

import { handleOperationWith } from "@lens-protocol/client/viem";
// …
const result = await setAppSponsorship(sessionClient, {  sponsorship: evmAddress("0x4567…"),  app: evmAddress("0x1234…")}).andThen(handleOperationWith(walletClient));

See the Transaction Lifecycle guide for more information on how to determine the status of the transaction.

Access Control

The App contract supports two roles: Owner and Administrator.

Administrators can:

  • Update the App Metadata

  • Update the App Rules

  • Update the App Feeds and Graph

  • Update the App Treasury

  • Update the App Sponsorship

The Owner can do everything the administrators can do, plus transfer ownership of the App to another address.

See the Team Management guide for more information on how to manage these roles.