listPage when you need a page boundary, a total count, or a saved offset. Use listAll with for await when you want to process every result without writing the paging loop.
The examples use client.ts from the quickstart.
Read one page
projects, datasets, fields, items, or another resource name. A projects page has this shape:
Most paginated methods accept an integer
limit from 1 to 100 and default to 20. audience.specializations.listPage and audience.specializations.listAll accept 1 to 1000 and default to 1000.
offset is a nonnegative integer and defaults to 0. To request the next page, add the returned pagination.limit to pagination.offset while hasMore is true.
Iterate through all results
listAll returns an async generator, not an array or a promise of an array. It fetches pages as you iterate and yields one resource at a time. Its limit sets the page size, not the total number yielded. Pass offset to start partway through a list; stop the loop with break when you have enough results.
Filters and resource IDs stay the same across requests. Page offsets advance using the server’s returned pagination values.
Method names
Collections nested under a resource use names such asdatasets.listFieldsPage / datasets.listAllFields, datasets.listItemsPage / datasets.listAllItems, and models.listVersionsPage / models.listAllVersions. Token pages use projects.listTokens / projects.listAllTokens.
Some lists, such as datasets.listSlicesPage, have only a page method. Others, such as files.list, return an array without pagination. Check the client method index for the method you need.