Skip to content

Latest commit

 

History

History
73 lines (46 loc) · 3.81 KB

setup-guide.md

File metadata and controls

73 lines (46 loc) · 3.81 KB

Setup Guide

Guide by JoshLmao

Part 1: Vercel & Deploy

Setup with a click of a button 😉

Deploy to Vercel

  1. Sign up or Sign in to use Vercel for hosting the repo. You could use another service like Heroku but this guide will use Vercel
  2. Fork spotify-now-playing-widget which is just a skeleton repo that contains the Spotify Now Playing specific features
  3. Go to your Vercel dashboard and select Import Project
  4. Paste the Git url of your forked repo. For example "https://github.com/manjillama/spotify-now-playing-widget"
  5. Leave the remaining settings for now and click 'Deploy'

Part 2: Configure Environment Vars

  1. Navigate to Spotify Dashboard and create a new app.

  2. Click, edit settings and add "https://localhost:3000/callback" to the "Redirect URIs" section

  3. Next, we need to do a Authoration Code flow auth request to retrieve a Refresh Token.

  4. Navigate to your deployment on Vercel and click on Settings, then click on "Environment Variables"

  5. Insert the following Variable names and insert your values from the previous steps

    Name: SPOTIFY_CLIENT_ID
    Value: MY_CLIENT_ID
    
    Name: SPOTIFY_CLIENT_SECRET
    Value: MY_SECRET_ID
    
    Name: SPOTIFY_REFRESH_TOKEN
    Value: MY_REFRESH_TOKEN
    
  6. Once done, navigate to one of your deployment url's and place "/now-playing" at the end. For example, "https://spotify-now-playing-widget.vercel.app/api/now-playing"

  7. Replace "MY_VERCEL_DEPLOYMENT_URL" in the following code with one of your deployment url's and insert it into any ReadMe.md

    <a href="https://MY_VERCEL_DEPLOYMENT_URL/now-playing">
        <img src="https://MY_VERCEL_DEPLOYMENT_URL/now-playing" width="256" height="64" alt="Now Playing">`
    </a>
    

That's it! Below is an example of what it should look like. If you have any problems, make sure to re-read the instructions and follow them precisely!