OptimoCMSDocs
SDK

Paginierung

Cursor-basierte Paginierung und Async Iteratoren im OptimoCMS TypeScript SDK.

Paginierung

Alle List-Endpoints geben paginierte Ergebnisse mit cursor-basierter Paginierung zurück.

Manuelle Cursors

const page1 = await cms.sites.list({ limit: 10 });
if (page1.pagination.nextCursor) {
  const page2 = await cms.sites.list({ limit: 10, cursor: page1.pagination.nextCursor });
}

Async Iterator (empfohlen)

for await (const site of cms.sites.listAll()) {
  console.log(`${site.name} — ${site.domain}`);
}

Nächste Schritte

On this page