Projects

envless.projects.iterate()

Stream projects one row at a time

ts
iterate(options?: ScopedSortedListOptions): AsyncGenerator<ProjectResource, void, undefined>

Yields projects individually, fetching the next page only once the current one is drained. This keeps memory flat over large workspaces and lets you stop early.

It returns an async generator, not a promise, so do not await the call itself: put it straight into a for await loop. No request is issued until the first iteration, and breaking out of the loop leaves the remaining pages unfetched.

Example

ts
for await (const project of envless.projects.iterate({ product: 'billing' })) {
    console.log(project.slug)
}

Parameters

ParameterTypeRequiredDescription
options.productstringNoProduct slug or product uniqueId to restrict the stream to one product.
options.limitnumberNoPage size fetched behind the scenes, clamped to 100.
options.offsetnumberNoRow to start streaming from.
options.searchstringNoCase insensitive substring match against project name and slug.
options.orderstringNoDefaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt.
options.signalAbortSignalNoCancels the in flight page request and ends the stream.

Returns

An AsyncGenerator that yields ProjectResource values until the pages run out.

Reads the projects collection. list returns one page as { items, pagination }, listAll collects every page into an array, and iterate streams one item at a time without buffering the whole set.

Worth knowing

  • The offset advances by the number of rows actually received, so projects created mid walk can shift the window.
  • Use this rather than listAll when you only need the first match, since it stops fetching the moment you break.

Required scopes

projects:read

Underlying endpoint

GET /projects

Request and response schema, every error code, and a live playground.

In Python

envless.projects.iterate()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.projects.iterate

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->projects->iterate()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.