This service allows you to bypass CORS issues for your API calls.
When your app is live on your registered domain, include the X-User-Email
header with your registered email in your fetch request.
const target = encodeURIComponent('https://api.example.com/data');
const workerUrl = `https://cors.utilitykit.workers.dev//?corsUrl=${target}`;
fetch(workerUrl, {
method: 'GET', // Or 'POST', etc.
headers: {
// REQUIRED: Your registered email
'X-User-Email': 'you@example.com'
}
})
.then(res => res.json())
.then(data => console.log(data));
When you register, you will receive a Development Token. Use this token in the X-Dev-Token
header to make requests from localhost
.
const target = encodeURIComponent('https://api.example.com/data');
const workerUrl = `https://cors.utilitykit.workers.dev/?corsUrl=${target}`;
fetch(workerUrl, {
method: 'GET',
headers: {
// REQUIRED: Your unique development token
'X-Dev-Token': 'YOUR_DEV_TOKEN_HERE'
}
})
.then(res => res.json())
.then(data => console.log(data));