Spotify API for your playback powered by Cloudflare Workers
MIT License
/now-playing
returns current state of playback in your Spotify/top-tracks
- return your top-10 tracksRequirements:
node >= v14.16.0
yarn >= 1.22.10
yarn
in folder with the project to get dependencies installedyarn auth
and authorize on Cloudflareyarn deploy
for deploying the worker%domain/auth
. Example https://spotify-worker.0050004d.workers.dev/auth
SPOTIFY_CLIENT_ID
SPOTIFY_CLIENT_SECRET
with encryptionENV
variable and set it to production
Deployed to %domain
on the worker page)https://spotify-worker.0050004d.workers.dev
refresh_token
and it to environment variables as SPOTIFY_REFRESH_TOKEN
with encryptionFinally you can open %domain/now-playing
or %domain/top-tracks
. For example https://spotify-worker.0050004d.workers.dev/now-playing or https://spotify-worker.0050004d.workers.dev/top/tracks
Install Dependencies
yarn
in folder with the project to get dependencies installedhttp://localhost:8787/auth
to Redirect URIs
wrangler.toml
wrangler secrets set SPOTIFY_CLIENT_SECRET
http://localhost:8787/auth
refresh_token
and set it as a secret wrangler secrets set SPOTIFY_REFRESH_TOKEN