Skip to Content
AppsList apps

List apps

client.apps.list() returns a page of apps (cursor-style pagination). Choose an approach below based on how much control you need over paging.

One page at a time

Use this when you build UI with Next/Previous, tables, or APIs that expose one page per request. You call list() for each screen, read page.data, and pass startingAfter / starting_after when hasMore / has_more is true.

list-page.js
1
// MY_APP_JSON =// { ... }
12
 
13
const page = await client.apps.list({
14
  limit: 10, // max apps per page (1–100)
15
  sortBy: "NEWEST", // other options: "OLDEST", "MOST_ACTIVE"
16
  collaborating: false, // true = include apps shared with you from other namespaces
17
});
18
// Should return: {// { ... }
25
console.log(page.data);
26
console.log(page.hasMore, page.nextPageCursor);
27
 
28
if (page.hasMore) {
29
  const nextPage = await client.apps.list({
30
    limit: 10,
31
    startingAfter: page.nextPageCursor,
32
  });
33
  console.log(nextPage.data);
34
}

Collect a bounded set

Use this when you only need up to N apps and do not want to write the paging loop yourself. In JavaScript, chain autoPagingToArray({ limit: N }) on list() — the SDK fetches pages until it reaches your cap or runs out of apps. In Python, use Stream every app below and stop after N items if you need a cap.

list-auto-paging.js
1
const firstFiveApps = await client.apps
2
  .list({ limit: 2, sortBy: "OLDEST", collaborating: false })
3
  .autoPagingToArray({ limit: 5 }); // max total apps to collect across pages
4
// Should return: [ MY_APP_JSON, ... ]
5
console.log(firstFiveApps);

Stream every app

Use this for scripts, exports, or sync jobs when you want to walk the full list. The SDK keeps requesting pages until there are no more results. In JavaScript use for await; in Python, iterate the object returned by list().

list-stream.js
1
for await (const app of client.apps.list({
2
  limit: 25,
3
  sortBy: "MOST_ACTIVE",
4
  collaborating: false,
5
})) {
6
  // Should log: MY_APP_JSON
7
  console.log(app.id, app.name, app.url);
8
}

Source: stackmachine/sdks  examples.