// for node-fetch fetch(url, { ... headers: { 'Authorization': 'Basic ' + Buffer.from(`${username}:${password}`, 'binary').toString('base64') } ... })