listAll(project: string, environment: string, options?: ScopedListOptions): Promise<Array<VersionResource>>Walks every page and resolves the flattened array of versions, newest first. An environment is capped at 1000 versions on every plan, so the result stays bounded even on a long lived project.
options.limit is the page size used while walking, not a cap on how many versions come back: a limit of 5 still returns the whole history, just in more round trips. It is clamped to the API maximum of 100, so asking for more buys nothing.
Example
const versions = await envless.versions.listAll('api', 'production', { product: 'billing' })
console.log(versions.length, versions[0]?.label)Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug or project uniqueId. |
environment | string | Yes | Environment slug, since an environment uniqueId will not resolve here. |
options.product | string | No | Product slug used to disambiguate a project slug shared across products. |
options.limit | number | No | Page size used while walking, clamped to 100. |
options.offset | number | No | Row to start the walk from. |
options.signal | AbortSignal | No | Cancels every request in the walk. |
Returns
Array<VersionResource> holding every snapshot taken for the environment.
Reads the versions 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
- Nothing resolves until the final page lands. Use
iteratewhen you want to act on versions as they arrive. - Rows carry
variableCountonly, so reading the values behind every version costs oneenvless.versions.getper row. - On the Free plan only the latest version is listed; the older ones are stored but need Dev or above to be read, and reading one there is 402
plan.upgrade_required.
Required scopes
versions:read
Underlying endpoint
GET /projects/{slug}/environments/{environmentSlug}/versions
Request and response schema, every error code, and a live playground.
In Python
envless.versions.list_all()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.versions.list_all
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->versions->listAll()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.