import { Apideck } from "@apideck/unify";
const apideck = new Apideck({
apiKey: process.env["APIDECK_API_KEY"] ?? "",
consumerId: "<insert-consumer-id-here>",
appId: "<insert-application-id-here>",
});
async function run() {
const result = await apideck.crm.contacts.list({
serviceId: "salesforce",
filter: {
name: "Elon Musk",
firstName: "Elon",
lastName: "Musk",
email: "elon@tesla.com",
phoneNumber: "111-111-1111",
companyId: "12345",
ownerId: "12345",
},
sort: {
by: "created_at",
direction: "desc",
},
passThrough: {
"search": "San Francisco",
},
fields: "id,updated_at",
});
for await (const page of result) {
// Handle the page
console.log(page);
}
}
run();