Members

envless.members.iterate()

Stream workspace members one row at a time

ts
iterate(options?: MemberListOptions): AsyncGenerator<MemberResource, void, undefined>

Yields members individually and fetches the next page only once the current one is drained. Use it when you want to stop at the first match instead of loading the whole set.

It returns an async generator, not a promise, so do not await the call itself: put it straight into a for await loop. No request goes out until the first iteration, and breaking out of the loop leaves the remaining pages unfetched.

Example

ts
for await (const member of envless.members.iterate()) {
    if (member.user?.email === 'dev@example.com') {
        console.log(member.id, member.role?.name)
        break
    }
}

Parameters

ParameterTypeRequiredDescription
options.limitnumberNoPage size fetched behind the scenes, clamped to 100.
options.offsetnumberNoRow to start streaming from.
options.searchstringNoCase insensitive substring match on the member name, email or role name.
options.roleIdstringNoOnly members holding this role, by the role id from roles.list.
options.signalAbortSignalNoCancels the in flight page request and ends the stream.

Returns

An AsyncGenerator that yields MemberResource values until the pages run out.

Reads the members 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

  • The offset advances by the number of rows actually received, so members added mid walk can shift the window.
  • Most workspaces fit inside one page of 100, in which case this makes a single request and ends.

Required scopes

members:read

Underlying endpoint

GET /members

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

In Python

envless.members.iterate()

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

In Ruby

Envless.members.iterate

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

In PHP

$envless->members->iterate()

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