Products

envless.products.listProjects()

List the projects inside one product

ts
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

ts
const page = await envless.products.listProjects('billing', { limit: 25 })

for (const project of page.items) {
    console.log(project.slug, project.product?.slug)
}

Parameters

ParameterTypeRequiredDescription
slugstringYesProduct slug, or the product uniqueId when the value is UUID shaped.
options.limitnumberNoRows per page, a whole number from 1 to 100.
options.offsetnumberNoRows to skip, a whole number of 0 or greater.
options.searchstringNoCase-insensitive substring match against project name and slug.
options.orderstringNoDefaults to name, which sorts A to Z. Pass asc for oldest first or desc for newest first on createdAt.
options.signalAbortSignalNoCancels 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.totalCount counts 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.