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
for await (const member of envless.members.iterate()) {
if (member.user?.email === 'dev@example.com') {
console.log(member.id, member.role?.name)
break
}
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options.limit | number | No | Page size fetched behind the scenes, clamped to 100. |
options.offset | number | No | Row to start streaming from. |
options.search | string | No | Case insensitive substring match on the member name, email or role name. |
options.roleId | string | No | Only members holding this role, by the role id from roles.list. |
options.signal | AbortSignal | No | Cancels 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.