I tried to fetch some data with the twitch.tv Api on a little JavaScript project.
Here is the fetch request :
fetch("https://api.twitch.tv/helix/chat/emotes/global", {
headers: {
Authorization: "Bearer XXX",
ClientId: "MY_ID"
}})
I tried to fetch the data on an vercel site and got this error
Access to fetch at ‘https://api.twitch.tv/helix/chat/emotes/global’ from origin “MY-WEBSITE” has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
None of the solutions I tried worked and I thought its a vercel only error so it uploaded the code on my own website, but still the same error
I have no idea what is worng
I found this guide but it wasn’t helpfull
Also found this site wich also didn’t work