listProjects(slug: string, options?: SortedListOptions): Promise<Page<ProjectResource>>Fetches one page of the projects that belong to a single product. The rows match the flat project list filtered by product, but the scope comes from the path and the key needs both products:read and projects:read.
Prefer this over the workspace-wide project list whenever you care about one product: project slugs are unique per product only, so the flat list can hold the same slug more than once. A key restricted to projects in a different product resolves an empty page instead of failing, so an empty items array is not proof that the product has no projects.
Example
const page = await envless.products.listProjects('billing', { limit: 25 })
for (const project of page.items) {
console.log(project.slug, project.product?.slug)
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
slug | string | Yes | Product slug, or the product uniqueId when the value is UUID shaped. |
options.limit | number | No | Rows per page, a whole number from 1 to 100. |
options.offset | number | No | Rows to skip, a whole number of 0 or greater. |
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 request. |
Returns
Page<ProjectResource> holding items and the pagination envelope.
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
pagination.totalCountcounts only the projects this key is allowed to see.
Required scopes
products:read and projects:read
Underlying endpoint
GET /products/{slug}/projects
Request and response schema, every error code, and a live playground.
In Python
envless.products.list_projects()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.products.list_projects
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->products->listProjects()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.