Pagination
Every list method returns a page holding the current items, a total (when the API reports it), and a link to the next page. You can iterate one page or transparently across all of them.
Iterate everything
- Node.js
- Go
A page is async-iterable across every page:
const rooms = await client.rooms.list({ perPage: 50 });
for await (const room of rooms) {
console.log(room.roomId);
}
ListAutoPaging returns a Go 1.23 range-over-func iterator:
for room, err := range client.Rooms.ListAutoPaging(ctx, videosdk.RoomListParams{}) {
if err != nil {
return err
}
fmt.Println(room.RoomID)
}
Work with one page
- Node.js
- Go
const first = await client.rooms.list({ perPage: 20 });
first.data; // items on this page
first.total; // total across all pages, when reported
first.hasNextPage; // whether another page exists
page, err := client.Rooms.List(ctx, videosdk.RoomListParams{
ListParams: videosdk.ListParams{PerPage: videosdk.Int(20)},
})
for _, room := range page.Data {
fmt.Println(room.RoomID)
}
if page.HasNextPage() {
page, err = page.NextPage(ctx)
}
Parameters
Every list method accepts a page number, a page size, and a cursor (from a previous page) alongside its own filters.
- Node.js
- Go
await client.rooms.list({ page: 2, perPage: 50 });
client.Rooms.List(ctx, videosdk.RoomListParams{
ListParams: videosdk.ListParams{Page: videosdk.Int(2), PerPage: videosdk.Int(50)},
})
Got a Question? Ask us on discord

