Cannot fetch url with custom extension (sigma - javascript)

Cannot fetch url with custom extension (sigma - javascript)

Hello

i try to make my first extension with API request, i have two cases
1) this a deluge code attach to a button --> this one works very well
  1. response = invokeurl
  2. [
  3. url :"my_api_fetch_url"
  4. type :GET
  5. headers:{"api_key":"myapikey","accept":"application/json","content-type":"application/json"}
  6. ];
  7. info response;
2) The second one have to do the same but by javascript, 
// Your API Key
const apiKey = "myapikey";

// The URL for the GET request
const url = "my_api_fetch_url";
// The GET request using fetch
fetch(url, {
method: "GET", // Specify the HTTP method
headers: {
"accept": "application/json", // Specify that we expect JSON in return
"content-type": "application/json", // Content type to application/json
"api_key": apiKey // API Key as required by the API
}
})
.then(response => {
if (!response.ok) {
throw new Error(`Error: ${response.status} ${response.statusText}`);
}
return response.json(); // Parse the response JSON
})
.then(data => {
console.log("Success:", data); // Handle the successful response output
})
.catch(error => {
console.error("Error:", error); // Handle errors
});
That code come from Connected App call when click on a button
So that code not working, always get error 400
Fetch API cannot load due to access control checks
may be because of localhost : https://127.0.0.1:5000/
in my manifest i whitelist url etc
Note that in postman it works very well, i think is related with Host in the headers

Thanks for you insights