const result = await client.contacts.list({
limit: 50,
});
for (const contact of result.items) {
console.log(contact.id, contact.phoneNumber);
}
// Filter by phone number
const result = await client.contacts.list({
phoneNumber: "+1415",
});
// Pagination
let cursor: string | undefined;
do {
const result = await client.contacts.list({ cursor, limit: 50 });
for (const contact of result.items) {
console.log(contact.id);
}
cursor = result.nextCursor ?? undefined;
} while (cursor);