A middleware API for the Spotify API with automatic token refresh.
Developed for Spotify Control but can probably be used for other apps.
- Install Node.js
- Run
npm install
- With your Spotify account, log in to the Spotify Developer Dashboard
- Create a new app
- After creation, add a Redirect URI under Edit settings. This must match the URI for the frontend.
- Set
redirect_uri
inindex.js
to your frontend URI. - Create a copy of
spotify_ids_template.js
and name itspotify_id.js
- Copy the Client ID and Client Secret from the Spotify app to the file.
Run the API with
node index.js
If you want hot reload, use nodemon
npm install -g nodemon
npm start