Loading...
Please wait while we prepare your content
We use cookies to enhance your experience, analyze site usage, and assist in our marketing efforts. You can manage your preferences or learn more in our Cookie Policy.
All list endpoints return cursor-based paginated responses. Use manual pagination or async generators for automatic iteration.
interface PaginatedResponse<T> {
data: T[];
meta: {
total: number;
limit: number;
cursor: string | null;
hasMore: boolean;
};
}// Manual pagination
let cursor: string | undefined;
do {
const response = await lystica.contacts.list({ limit: 100, cursor });
process.stdout.write(`Fetched ${response.data.length} contacts\n`);
cursor = response.meta.cursor ?? undefined;
} while (cursor);
// Automatic pagination (async generator)
for await (const contact of lystica.contacts.listAll({ country: "US" })) {
console.log(contact.email);
}