[[Authorizationヘッダー]]で`Basic ...`を指定する。 ```ts const auth = btoa(`${username}:${password}`) await fetch(url, { headers: { authorization: `Basic ${auth}`, }, }); ``` ## 参考 - [【JavaScript】Fetch API で Basic 認証 \| 高木のブログ](https://takagi.blog/fetch-api-with-basic-authentication-in-javascript/)