Test app for the Authorization Code with PKCE Flow for Spotify's Web API. Built with Vite.
- Clone this repo locally and create an
.env
file at the root level. - Follow Spotify's documentation to create a new app and set the Redirect URI to whichever localhost port your project is running (this repo runs on
http://localhost:5173
by default). - Once the app has been created, add the generated Client Id to your
.env
with the nameVITE_SPOTIFY_CLIENT_ID
- Run
npm i
to install dependencies. - Run
npm run dev
to run the development server. - Upon first visiting the page, the user will automatically be prompted to provide authorization for the app to use their Spotify the page. Upon redirect, an access token will be requested from Spotify's API and will be stored in localstorage.