Skip to main content
List operations like listBasins, listStreams, and listAccessTokens return paginated results. SDKs provide automatic pagination helpers that handle async fetching of subsequent pages transparently.

Usage

Instead of manually handling hasMore and startAfter cursor parameters, use the paginator variants which return an iterable that automatically fetches pages as needed:
// Iterate through all streams with automatic pagination
for await (const stream of basin.streams.listAll()) {
	console.log(stream.name);
}

Filtering

Paginators accept the same filter options as their single-page list analogs:
// List streams with a prefix filter
for await (const stream of basin.streams.listAll({ prefix: "events/" })) {
	console.log(stream.name);
}

Deleted Resources

Paginators automatically filter out resources that are pending deletion. This is useful because delete operations mark resources for deletion, but actual garbage collection happens asynchronously. To include deleted resources in the results:
// Include streams that are being deleted
for await (const stream of basin.streams.listAll({ includeDeleted: true })) {
	console.log(stream.name, stream.deletedAt);
}