This is a serverless API proxy deployed on Vercel to handle Spotify API calls made from my personal website
-
Install dependencies:
npm install
-
Set up environment variables in Vercel dashboard:
SPOTIFY_CLIENT_IDSPOTIFY_CLIENT_SECRETSPOTIFY_REFRESH_TOKEN
POST /api/token- Get Spotify access tokenGET /api/currently-playing- Get currently playing track (requires Authorization header)
- Push this code to a GitHub repository
- Connect the repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy!
npm run dev