Cloudflare Workers-based API for fetching Spotify account Data, such as the current song, 10 most recent songs and top 10 songs.
- Install and configure Wrangler/Workers CLI
- Install Node.JS and NPM
- Create an app on Spotify Developers
- Get your Refresh Token by following the Spotify Auth Guide
- Copy the
wranger.toml.examplefile towrangler.toml - Enter your Cloudflare Account ID into the
account_idfield in yourwrangler.tomlfile - Add the secrets
SPOTIFY_CLIENT_ID,SPOTIFY_CLIENT_SECRET,SPOTIFY_REFRESH_TOKENby running$ wrangler secret put SECRET_NAME - Publish the worker to Cloudflare
$ wrangler publish