Generate Spotify Access Tokens
This app uses Authorization Code Flow to authenticate users:
- This project sets the CLIENT_ID and CLIENT_SECRET environment variables for the relevant Spotify App.
- We generate a unique code that you will use to authenticate to us:
zkgE5jU6504oiF9L
- You can pick which scopes to authorize.
- We construct a URL to redirect you to, which will ask you to authorize the app on Spotify.
- You are redirected back here, with a code in the URL.
- We exchange the code for an access token and refresh token, which we save.
- You can request your access token at
https://neverstew--5e762206e33d11efa9eae6cdfca9ef9f.web.val.run/token?state=zkgE5jU6504oiF9L
- If your access token expires, we use the refresh token to get a new one.
- Use your access token to make requests to the Spotify API by importing `getSpotifyToken` in your other vals.