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: SsRsu6RbS8owyz1K
  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://charmaine--a0602f82a0404c9cb4ee8efddbb95d7a.web.val.run/token?state=SsRsu6RbS8owyz1K
  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.