Skip to main content
The SDK supports multiple pagination methods for handling large datasets. Best for real-time data and large datasets. Uses an opaque cursor to track position.
Cursor-based pagination is stable even when records are added or removed between requests.

Async Iterator (Auto-Pagination)

Process all records without managing pagination manually:
With filtering:
The iterator automatically fetches subsequent pages as you iterate.

Pagination Utilities

The SDK provides helpers for common pagination patterns:

Collect All

Collect all items into an array:
Use with caution on large datasets. Consider using collectUpTo or the async iterator for large collections.

Collect Up To N

Collect a maximum number of items:

Get First

Get just the first item:

Offset-Based Pagination

For UI pagination with page numbers:
Offset pagination is less efficient for large datasets and can skip or duplicate records if data changes between requests.

Constants

Comparison

Pagination Response

All list() methods return a paginated response:

Full Example

Processing all clients in batches: