-
Serve the redirect_page on localhost:8000
cd redirect_page
python -m http.server
-
Open a new terminal at the project folder, execute the "authURL" script
node authURL.js
-
Access the URL generated by the auth.js script
-
Click on the 'Get Code' button
-
The code will be copied to your clipboard. If not, you can get him from the textarea
-
Paste the code into the terminal input
-
Execute "token.js" script
node token.js
-
Test the credentials by running "test.js", it should output your spotify's username
node test.js
-
Your credentials are now saved into the "setup.json" file
-
You may now finish the python server (Ctrl+C) and close the terminals
The playground function has a script that demonstrate a simple implementation.
It logs information about the 5 most recently played tracks from your spotify playlist.
To execute it run the commands described above, followed by:
node playground/recently_songs.js
Be careful when using your credentials, try to follow security practices when using this script and DO NOT ALLOW your clientSecret, access or refresh tokens or any other sensitive information to be exposed to unkown people.