import { MailChannels } from "mailchannels-sdk";
const { MAILCHANNELS_API_KEY } = process.env;
if (!MAILCHANNELS_API_KEY) throw new Error("Set MAILCHANNELS_API_KEY before running");
const mailchannels = new MailChannels(MAILCHANNELS_API_KEY);
const { data, error } = await mailchannels.metrics.recipientBehaviour({
startTime: "2026-01-01T00:00:00Z",
endTime: "2026-01-31T23:59:59Z",
});
if (error) {
console.error("Get recipient behaviour metrics failed:", error);
process.exit(1);
}
console.log(data);