Generate Spotify Access Tokens

This app uses Authorization Code Flow to authenticate users:

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

If you get in a broken state, you can always remove access to this app from your Spotify account or clear your cookies and begin the token generation process again.