-
First, get your credentials.
-
Click this nice button:
-
Use the following environment variables:
FIREBASE_CREDS
: Your Firestore Base64 secretCLIENT_ID
: Your Spotify app client IDCLIENT_SECRET
: Your Spotify app client secretREDIRECT_URL
: Make thishttps://localhost:5000/callback/q
for now, we'll fix it laterSCOPES
: Make thisuser-read-playback-state user-read-currently-playing user-read-recently-played user-top-read
-
Click the "Continue to Dashboard" button.
-
Copy the URL - it's the first thing under "Domains".
-
Hop over to Settings > Environment Variables and change the
REDIRECT_URL
to<URL you just copied>/callback/q
e.g. if your URL ishttps://github-spotify.vercel.app/
, you're going to addhttps://github-spotify.vercel.app/callback/q
-
Change the redirect URL for your Spotify app to this value too by going to the Dashboard, selecting your app > Settings > Edit > Redirect URIs and clicking "Save" when you're done.
-
Now, go back to Deployments > Three-dot menu > Redeploy > Use existing build cache > Redeploy.
-
Enjoy! Now check out the docs for more info.
-
Make a new Firebase project (call it whatever you want), and a Cloud Firestore.
Google has instructions here.
You want to choose "Production mode" when it asks, as well as a region geographically close to you.
-
Go to the console if it doesn't pop up, and select your project.
-
Click the gear icon in the top left > Project settings > Service accounts > Generate new private key.
-
Now we need to convert the
.json
file we just downloaded to Base64:-
You can use an online service like base64encode.org.
-
Or your terminal, if you're familiar:
$ jq -r '. | @base64' ~/Downloads/github-spotify-readme-firebase-adminsdk.json # *nix $ # TODO add ex. for pwsh
-
-
Keep this Base64 string, this is our Firebase credential.
-
Go to https://developer.spotify.com/dashboard/create and make an app.
- For the redirect URI, make it
https://localhost:5000/callback/q
for now, we'll change it later - Tick just "Web API" under "Which API/SDKs are you planning to use?"
- For the redirect URI, make it
-
Copy your client ID and secret, we'll need these next.