Products

envless.products.list()

List products in a workspace page by page

ts
list(options?: SortedListOptions): Promise<Page<ProductResource>>

Fetches one page of the products the key can reach, unwrapped into items plus a pagination envelope. Private products with no grant for the key owner are filtered out before pagination is applied, so pagination.totalCount is the number of products this key can see and never the raw workspace total.

Every row carries locked, which is true for products sitting beyond the plan allowance. Locked products still list and still read, but an update against one is refused. search matches name and slug, order defaults to name and sorts A to Z, with asc and desc sorting oldest and newest first on createdAt.

Example

ts
const page = await envless.products.list({ limit: 10, search: 'api' })

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

Parameters

ParameterTypeRequiredDescription
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 product 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<ProductResource> holding items and the pagination envelope.

Reads the products 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 limit outside 1 to 100 is rejected as invalid pagination rather than clamped.
  • Pagination happens in memory after the access filter, so page boundaries shift if grants change between calls.

Required scopes

products:read

Underlying endpoint

GET /products

Request and response schema, every error code, and a live playground.

In Python

envless.products.list()

The same method in envless-sdk, the Python SDK, with the same request, retries and errors.

In Ruby

Envless.products.list

The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.

In PHP

$envless->products->list()

The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.