Pagination
All list endpoints return cursor-based paginated responses. Use manual pagination or async generators for automatic iteration.
Response shape
interface PaginatedResponse<T> {
data: T[];
meta: {
total: number;
limit: number;
cursor: string | null;
hasMore: boolean;
};
}Example
// 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);
}