Get all events with pagination using cursor
Since there can be a large number of events, they are paginated. You can go through the results using thecursor.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
cursor.
import { Client } from "@upstash/qstash";
const client = new Client({ token: "<QSTASH_TOKEN>" });
const allEvents = [];
let cursor = null;
while (true) {
const res = await client.events({ cursor });
allEvents.push(...res.events);
cursor = res.cursor;
if (!cursor) {
break;
}
}
Was this page helpful?