Skip to content

Pagination

Every list endpoint — feeds, followers/following, reactions, notifications — pages with an opaque keyset cursor, never OFFSET. The cursor encodes a position on (activity_time DESC, activity_id DESC) (or the equivalent ordering column for followers/reactions/notifications), so pages stay correct even as new rows are inserted ahead of where you’re reading — an OFFSET-based page would skip or repeat rows under concurrent writes. Treat the cursor as opaque: don’t parse it, just pass back whatever the previous page returned as next.

const page = await client.feed('user', 'maya').get({ limit: 20 })
page.results // Activity[]
page.next // string | null — opaque cursor, or null when there's no more

Pass the previous page’s next back in as next to get the following page. The same { limit, next } shape works on every paginated method — feed().get(), feed().followers()/.following(), reactions.list(), and notifications.get().

let page = await client.feed('user', 'maya').get({ limit: 20 })
while (page.next) {
page = await client.feed('user', 'maya').get({ limit: 20, next: page.next })
}

See feeds for the full set of feed reads this applies to.