Handle paginated responses with the Fathom SDKs
import { Fathom } from 'fathom-typescript'; const fathom = new Fathom({ security: { apiKeyAuth: "YOUR_API_KEY" } }); const result = await fathom.listMeetings({}); for await (const page of result) { console.log(page); }
import { Fathom } from 'fathom-typescript'; async function getAllMeetings() { const fathom = new Fathom({ security: { apiKeyAuth: "YOUR_API_KEY" } }); const result = await fathom.listMeetings({}); const allMeetings: any[] = []; for await (const page of result) { if (page.items) { allMeetings.push(...page.items); } } console.log(`Total meetings: ${allMeetings.length}`); return allMeetings; }
for await...of
while res is not None