listAll(project: string, options?: ScopedSortedListOptions): Promise<Array<EnvironmentSummaryResource>>Walks every page of the environments in a project and resolves one flat array. limit sets the page size, capped at 100, not the number of rows you get back, so raising or lowering it changes the request count and nothing else.
All rows are buffered in memory before the promise settles, and each row has the same fields list returns, exposed and updatedAt included. Environment counts are small by design, since the allowance is per project rather than per workspace, so this is usually the read you want.
Example
const environments = await envless.environments.listAll('api')
console.log(environments.length)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug or uniqueId that owns the environments. |
options.product | string | No | Product slug that disambiguates an ambiguous project slug. |
options.limit | number | No | Page size used for each underlying request, capped at 100. |
options.offset | number | No | Rows to skip before collection starts. |
options.search | string | No | Case insensitive substring match on the environment name or slug. |
options.order | string | No | asc or desc sorts by creation time, oldest or newest first. Anything else, or nothing, sorts by name. |
options.signal | AbortSignal | No | Cancels every request in the walk. |
Returns
Array<EnvironmentSummaryResource> with one entry per environment in the project.
Reads the environments 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
- An ambiguous project slug fails on the first request, so nothing is collected and no partial array is returned.
- Aborting through
options.signalrejects the whole call; there is no partial result to recover.
Required scopes
environments:read
Underlying endpoint
GET /projects/{slug}/environments
Request and response schema, every error code, and a live playground.
In Python
envless.environments.list_all()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.environments.list_all
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->environments->listAll()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.