I haven’t used got at all but I found some request methods on using it but I am getting
(node:6489) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_URL]: Invalid URL: id.twitch.tv/oauth2/token?client_id=config.twitchClientID&client_secret=twitchClientSecret&grant_type=client_credentials
My code snippet for the got request
let url = `id.twitch.tv/oauth2/token?client_id=${config.twitchClientID}&client_secret=${config.twitchClientSecret}&grant_type=client_credentials`; got({ url, method: 'POST', headers: { 'Client-ID': config.twitchClientID, 'Client-Secret': config.twitchClientSecret }, responseType: 'json' }) .then(res => { console.log('Got', res.body.data[0]); if(res.body.pagination) { fetch(res.body.pagination.cursor); } });