add these six variables to your .env file:
SPOTIFY_ID #spotify id of your user
SPOTIFY_CLIENT_ID #client id of your spotify app
SPOTIFY_CLIENT_SECRET #client secret of your spotify app
SERVER_URL #ip of your server (or <ip>:<port> of server)
PORT #port you want your server to run on
CLIENT_URL #url where your webapp is hosted
VITE_SERVER_SOCK #<ip>:<port> of where your server is hostedyou can use SERVER_IP=http://localhost and CLIENT_URL=http://localhost:3000 if you are running locally
the only env required by the webapp is VITE_SERVER_SOCK
- create a .tokens.json file in the root directory containing
{} - change requested scopes in index.cjs /auth/login to the server scopes commented above the function
- run using
yarn dev - login with spotify and allow access to the app
- copy the new url with the access_token and refresh_token
- paste these in .tokens.json like so:
{
"access_token": "<access_token>",
"refresh_token": "<refresh_token>"
}run server and webapp with yarn dev
run server only with yarn server
run webapp only with yarn webapp