Skip to content

A services that can be deployed using Heroku to handle swapping and refreshing of spotify tokens

Notifications You must be signed in to change notification settings

alfiedouglas0/spotify-token-refresh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spotify-token-refresh

Due to the design of OAUTH2, which is used by the spotify api, each user access token will expire after 1 hour - meaning the user will need to login again unless you implement the Authorization Code Flow.

This repository uses the code from the example server in the react-native-spotify repository, and is suitable to be deployed in a click:

Deploy

This will require you to enter:

  • SPOTIFY_CLIENT_ID - Your spotify app id, found the spotify developer dashboard
  • SPOTIFY_CLIENT_SECRET - Your spotify client secret, found the spotify developer dashboard
  • SPOTIFY_CLIENT_CALLBACK - Your spotify app redirect URL, found the spotify developer dashboard
  • ENCRYPTION_SECRET - Any arbitrary string to use to encrypt/decrypt refresh tokens

which can all be found in the spotify developer dashboard.

This will set up a server that will run for free! The only issue being that if the server has been inactive for over 30 minutes it will go to sleep, the only way I have found to get around this is to set up a service to ping your server every 5 minutes or so.

About

A services that can be deployed using Heroku to handle swapping and refreshing of spotify tokens

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published