Skip to content

Commit 84d693a

Browse files
committed
chore: updating README.md to reflect new cursor pagination methods [CAPI-2357]
1 parent de2e56c commit 84d693a

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,17 @@ The benefits of using the "plain" version of the client, over the legacy version
227227
- The ability to scope CMA client instance to a specific `spaceId`, `environmentId`, and `organizationId` when initializing the client.
228228
- You can pass a concrete values to `defaults` and omit specifying these params in actual CMA methods calls.
229229

230+
## Cursor Based Pagination
231+
232+
Cursor-based pagination is supported on collection endpoints for content types, entries, and assets. To use cursor-based pagination, use the related entity methods `getAssetsWithCursor`, `getContentTypesWithCursor`, and `getEntriesWithCursor`
233+
234+
```js
235+
const response = await environment.getEntriesWithCursor({ limit: 10 });
236+
console.log(response.items); // Array of items
237+
console.log(response.pages?.next); // Cursor for next page
238+
```
239+
Use the value from `response.pages.next` to fetch the next page.
240+
230241
## Legacy Client Interface
231242
232243
The following code snippet is an example of the legacy client interface, which reads and writes data as a sequence of nested requests:

0 commit comments

Comments
 (0)