An example server capable of swapping and refreshing tokens provided by Spotify API.
- Install dependencies using:
yarn # or npm install
- Create a
.env
file in the root of this directory with the following entries acquired from Spotify Developer Dashboard :
⚠️ Don't commit the.env
file to your repo⚠️
SPOTIFY_CLIENT_ID="client_id_from_spotify_dashboard"
SPOTIFY_CLIENT_SECRET="client_secret_from_spotify_dashboard"
SPOTIFY_CLIENT_CALLBACK="callback_registered_in_spotify_dashboard"
ENCRYPTION_SECRET="THISWILLBEABIGSECRET"
ENCRYPTION_METHOD="aes-256-ctr"
Can also specify PORT
if you want to run it on something other than 3000.
Optionally this can be done on the command line as well when starting up the server via node
- Run server using:
yarn start
- In your react-native app set
tokenSwapURL
tohttp://<SERVER_URL>:<PORT>/swap
andtokenRefreshURL
tohttp://<SERVER_URL>:<PORT>/refresh
, replacing<SERVER_URL>
and<PORT>
with your server URL and port.