mirror of
https://github.com/formbricks/formbricks.git
synced 2026-04-20 11:22:55 -05:00
Edit packages/lib/customerio.ts
This commit is contained in:
committed by
GitHub
parent
bcf039030e
commit
71075ea36a
@@ -7,9 +7,8 @@ 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",
|
||||
method: 'PUT',
|
||||
headers: {
|
||||
Authorization: `Basic ${auth}`,
|
||||
},
|
||||
@@ -19,9 +18,10 @@ export const createCustomerIoCustomer = async (user: TUser) => {
|
||||
}),
|
||||
});
|
||||
if (res.status !== 200) {
|
||||
console.log("Error sending user to CustomerIO:", await res.text());
|
||||
throw new Error(`Error sending user to CustomerIO: ${await res.text()}`);
|
||||
}
|
||||
} catch (error) {
|
||||
console.log("error sending user to CustomerIO:", error);
|
||||
console.error('Error sending user to CustomerIO:', error.message);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user