A demo showing how to authenticate against the Spotify API in a Nuxt.js application.
yarn install --immutable
Create a .env
file at the root of the project, and add the following properties:
SPOTIFY_CALLBACK_URL=http://localhost:3000/home
SPOTIFY_CLIENT_ID=YOUR_SPOTIFY_CLIENT_ID
SPOTIFY_LOGIN_URL=https://accounts.spotify.com/authorize
SPOTIFY_TOKEN_URL=https://accounts.spotify.com/api/token
SPOTIFY_USER_URL=https://api.spotify.com/v1/me
Replace YOUR_SPOTIFY_CLIENT_ID
with the ID you can get from the Spotify Developer Dashboard.
Don't forget to add
http://localhost:3000/home
to the list of redirect URIs in the app's settings!
yarn dev