Hi, I am currently using Klaviyo javascript client to do OnSite Activity:
I have tried to unsubscribe a profile from a list using below code structure:
const options = {
method: 'DELETE',
headers: {'content-type': 'application/json'},
body: JSON.stringify({
emails: email
})
};
fetch('https://a.klaviyo.com/api/v2/list/LIST_ID/subscribe?api_key=PRIVATE_API_KEY', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Unfortunately, I am getting CORS error, even though the site is made request over HTTPS.

How can I get resolve from this? Or How can I unsubscribe from a klaviyo list using JavaScript client?
Any help would be appreciate
Best answer by Brian Turcotte
View original