Edit packages/lib/customerio.ts

This commit is contained in:
review-agent-prime[bot]
2024-01-30 10:46:07 +00:00
committed by GitHub
parent bcf039030e
commit 7484a99ad5
+5 -5
View File
@@ -7,11 +7,11 @@ export const createCustomerIoCustomer = async (user: TUser) => {
return;
}
try {
const auth = Buffer.from(`${env.CUSTOMER_IO_SITE_ID}:${env.CUSTOMER_IO_API_KEY}`).toString("base64");
const res = await fetch(`https://track-eu.customer.io/api/v1/customers/${user.id}`, {
method: "PUT",
headers: {
Authorization: `Basic ${auth}`,
// existing code...
} catch (error) {
console.error("Error sending user to CustomerIO:", error);
throw error;
}
},
body: JSON.stringify({
id: user.id,