1
2
3
4
5
6
7
8
9
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
export let spotifyAPI = ({token, endpoint, ...params}) => fetchJSON(
`https://api.spotify.com/v1/${endpoint}?${new URLSearchParams(params)}`,
{
headers: { Authorization: `Bearer ${token}` },
...params
}
)