list(project: string, environment: string, options?: ScopedListOptions): Promise<Page<VariableResource>>Fetches one page of the variables in an environment, sorted by name A to Z. Soft deleted variables are excluded.
Every value and defaultValue comes back as ciphertext, because the server holds no key material and cannot decrypt anything. Run each one through decryptValue with the workspace passphrase and the workspaceId from envless.me.get(). Rows written before ciphertext was enforced can still hold plaintext, so test with isCiphertext rather than reading a failed decrypt as corruption. Pagination is limit and offset only, and a limit above 100 is rejected with 400 request.invalid_pagination rather than clamped.
Example
const page = await envless.variables.list('api', 'production', { limit: 50 })
console.log(page.pagination.totalCount)
console.log(page.items.map((variable) => variable.name))Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
project | string | Yes | Project slug the environment belongs to. |
environment | string | Yes | Environment slug to read variables from. |
options.limit | number | No | Page size between 1 and 100. |
options.offset | number | No | Number of variables to skip before the page starts. |
options.product | string | No | Product slug, needed when the project slug is not unique in the workspace. |
options.signal | AbortSignal | No | Cancels the request. |
Returns
Page<VariableResource> holding items plus a pagination envelope with totalCount and hasMore.
Reads the variables 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
- A project locked by the workspace plan refuses reads as well as writes, with 402
plan.upgrade_required. - A duplicate project slug across two products is 409
project.ambiguous_product. Retry withoptions.product.
Required scopes
variables:read
Underlying endpoint
GET /projects/{slug}/environments/{environmentSlug}/variables
Request and response schema, every error code, and a live playground.
In Python
envless.variables.list()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.variables.list
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->variables->list()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.