Help & Support

Fetch Apps

This guide will show you how to fetch App data in different ways.

Lens App data has a rich structure that includes the following information:

  • Addresses of the primitives contracts

  • App Metadata content

  • Time of creation

  • Owner of the App

To illustrate how to fetch apps, we will use the following fragments:

fragment App on App {  address  graphAddress  sponsorshipAddress  defaultFeedAddress  namespaceAddress  treasuryAddress  verificationEnabled  createdAt  metadata {    ...AppMetadata  }  owner}

Get an App

Use the fetchApp action to fetch a single App by address or by transaction hash.

import { evmAddress } from "@lens-protocol/client";import { fetchApp } from "@lens-protocol/client/actions";
import { client } from "./client";
const result = await fetchApp(client, {  app: evmAddress("0x1234…"),});
if (result.isErr()) {  return console.error(result.error);}
const app = result.value;

List Apps

Use the paginated fetchApps action to fetch a list of Apps based on the provided filters.

import { fetchApps } from "@lens-protocol/client/actions";
import { client } from "./client";
const result = await fetchApps(client, {  filter:{    searchQuery: "Lens",  }});
if (result.isErr()) {  return console.error(result.error);}
// items: Array<App>const { items, pageInfo } = result.value;

See the Pagination guide for more information on how to handle paginated results.

List App Users

Use the paginated fetchAppUsers action to fetch a list of users using an App based on the provided filters.

import { evmAddress } from "@lens-protocol/client";import { fetchAppUsers } from "@lens-protocol/client/actions";
import { client } from "./client";
const result = await fetchAppUsers(client, {  filter:{    searchBy: {      localNameQuery: "John",    }  }  app: evmAddress("0x1234…"),});
if (result.isErr()) {  return console.error(result.error);}
// items: Array<AppUser>: [{account: Account, lastActiveOn: Date, firstLoginOn: Date}, ...]const { items, pageInfo } = result.value;

See the Pagination guide for more information on how to handle paginated results.

List App Feeds

Coming soon

List App Groups

Coming soon

List App Signers

Coming soon