API Authentication in JS

Yes, but I’ll still need to send the client ID in the header and I think that’s the part that’s going wrong.
Correcting my code as described returns undefined for the call console.log(data);

            var XML = new XMLHttpRequest();
            
            XML.open("GET", "https://api.twitch.tv/helix/streams/?user_id=CHANNELID");
            XML.setRequestHeader('Client-ID', 'CLIENTID');
            var data = XML.send();
            console.log(data);