Skip to main content
Every list() method returns a Page<T>. Pages are async-iterable, so the simplest consumer iterates across every item across every page transparently.

Auto-iterate

for await (const env of await verial.environments.list()) {
  console.log(env.id)
}
The iterator fetches successive pages lazily as you consume items.

One Page at a Time

let page = await verial.environments.list({ limit: 50 })

do {
  for (const env of page.data) {
    console.log(env.id)
  }
  const next = await page.getNextPage()
  if (!next) break
  page = next
} while (true)

Page Surface

MemberTypeDescription
dataT[]Items in this page
hasNextPage()() => booleantrue if another page is available
getNextPage()() => Promise<Page<T> | null>Fetches the next page, or null if none
toJSON()() => { data, _meta }Serializable snapshot
_meta.nextstring | nullNext cursor
_meta.prevstring | nullPrevious cursor
_meta.limitnumberPage size

Options

All list methods accept:
OptionTypeDescription
cursorstringResume from a specific cursor
limitnumberItems per page

Early Exit

Stop iteration whenever you want — the SDK doesn’t prefetch pages.
for await (const run of await verial.runs.list()) {
  if (run.verdict === 'pass') {
    return run
  }
}