My current code is
function test(accessToken) {
const url = 'https://api.twitch.tv/helix/search/channels?query=a_seagull';
const headers = {'client-id' : clientID, 'Authorization': 'Bearer ' + accessToken};
const myHeaders = new Headers(headers);
console.log(myHeaders.get('Authorization'))
const options = {
method: "GET",
header: myHeaders
};
var myRequest = new Request(url,options);
fetch(myRequest)
.then( res => res.json() )
.then( data => {
console.log(data);
}
).catch(error=>console.log(error));
}
The error is still “OAuth token is missing”