fetch(url, { ...options, headers: { 'Authorization': 'Basic ' + btoa(`${username}:${password}`) } }) .then(response => response.json()) .then(json => console.log(json));