iterate(options?: SearchListOptions): AsyncGenerator<InviteResource, void, undefined>Returns an async generator that yields invitations individually and fetches the next page only once the current one is drained. Breaking out of the loop stops the requests, which makes this the cheapest way to find the invite for one email address.
The generator defaults to the maximum page size of 100 and clamps anything larger, so limit only ever makes pages smaller. Revoking or resending while you iterate mutates the underlying set that offsets are counted against, so collect the ids first and act on them after the loop.
Example
for await (const invite of envless.invites.iterate()) {
if (invite.email === 'dana@example.com') {
console.log(invite.id, invite.status, invite.resendCount)
break
}
}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
options.limit | number | No | Page size per request, capped at 100 and defaulting to 100. |
options.offset | number | No | Row the walk starts at, advancing by the number of items each page returns. |
options.search | string | No | Case insensitive substring match on the invited email address. |
options.signal | AbortSignal | No | Cancels the request that is in flight and ends the iteration. |
Returns
AsyncGenerator<InviteResource, void, undefined> yielding one invitation per step.
Reads the invites 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 generator is lazy, so no request is sent until you start consuming it.
Required scopes
members:read
Underlying endpoint
GET /invites
Request and response schema, every error code, and a live playground.
In Python
envless.invites.iterate()
The same method in envless-sdk, the Python SDK, with the same request, retries and errors.
In Ruby
Envless.invites.iterate
The same method in envless-sdk, the Ruby gem, with the same request, retries and errors.
In PHP
$envless->invites->iterate()
The same method in envless/sdk, the PHP SDK, with the same request, retries and errors.