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
for await (const project of envless.projects.iterate({ product: 'billing' })) {
console.log(project.slug)
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options.product | string | No | Product slug or product uniqueId to restrict the stream to one product. |
options.limit | number | No | Page size fetched behind the scenes, clamped to 100. |
options.offset | number | No | Row to start streaming from. |
options.search | string | No | Case insensitive substring match against project name and slug. |
options.order | string | No | Defaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt. |
options.signal | AbortSignal | No | Cancels 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
listAllwhen 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.