Mixpanel Community Icon

CORS Issue with Mixpanel API Integration: Seeking Solutions

·
·

đź‘‹ Hello, team! We are deploying Mixpanel through HTTP API and that it worked well on Postman. So we created an HTML file and uploaded it on S3. But there we are facing issue :

  1. 1.

    Access to fetch at 'https://api.mixpanel.com/engage#profile-set' from origin 'https://arbucket2.s3.ap-southeast-1.amazonaws.com' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

Also getting the same CORS issue while running on local host. And later when i remove the headers - "accept": "text/plain", "content-type": "application/json" the CORS error is getting solved but i am getting the debug - "Response from Mixpanel: 0" and its not getting update in mixpanel. What can be the issue? please help me out to reach the solution for this query. Below is the attachment of my index.html (with token removed)