README Generator

How to Add Spotify Now Playing to Your GitHub Profile README

The Spotify Now Playing widget displays your current or most recently played track directly on your GitHub profile. It pulls live data from the Spotify API and renders an animated card showing the album art, track name, and artist — giving your profile a dynamic, personal touch that static badges cannot match. This guide walks through setting up the novatorem/novatorem widget on Vercel, connecting it to your Spotify account, and embedding it in your README. The setup takes about 15 minutes and requires a free Spotify Developer account.

Quick Setup Steps

  1. 1

    Step 1: Fork the novatorem/novatorem GitHub repository.

  2. 2

    Step 2: Create a Spotify Developer app at developer.spotify.com and note your Client ID and Client Secret.

  3. 3

    Step 3: Deploy your fork to Vercel and add SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET as environment variables.

  4. 4

    Step 4: Visit your-app.vercel.app/login to complete the OAuth flow and obtain your SPOTIFY_REFRESH_TOKEN.

  5. 5

    Step 5: Add SPOTIFY_REFRESH_TOKEN to Vercel environment variables, redeploy, then paste the image markdown into your README.md and commit.

What Is the Spotify Now Playing Widget?

The Spotify Now Playing widget is an open-source service hosted on GitHub as novatorem/novatorem. It connects to the Spotify Web API using OAuth and exposes a small API endpoint that returns an SVG image of your current playback state. When you're actively listening, it shows the track in real time with an animated equalizer bar. When you're offline, it falls back to your most recently played track.

The widget is self-hosted on Vercel, which means you control the service and your Spotify credentials stay in your own environment variables. It renders as a standard image tag in your README, so it works everywhere GitHub markdown is rendered — profile pages, repository READMEs, and organization pages.

How to Set Up Spotify Now Playing

Follow these steps to deploy and connect the widget:

  1. Fork the repository at github.com/novatorem/novatorem.
  2. Go to the Spotify Developer Dashboard (developer.spotify.com) and create a new application. Set the redirect URI to https://your-vercel-app.vercel.app/callback.
  3. Copy your Client ID and Client Secret from the Spotify app settings.
  4. Deploy your forked repo to Vercel. During setup, add these environment variables: SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET.
  5. Visit https://your-vercel-app.vercel.app/login in your browser to complete the OAuth flow and get your SPOTIFY_REFRESH_TOKEN.
  6. Add SPOTIFY_REFRESH_TOKEN as a fourth environment variable in Vercel and redeploy.
  7. Add to your README:
[![Spotify](https://your-vercel-app.vercel.app/api/spotify)](https://open.spotify.com/user/YOUR_SPOTIFY_ID)

Customizing the Spotify Widget

The default widget renders with a dark card background that fits most dark-mode GitHub profiles. You can modify the visual style by editing the api/spotify.js file in your fork before deploying. Common customizations include changing the card background color, adjusting the font size, or modifying the animated equalizer bar colors to match your profile's accent color.

For the link destination, replace YOUR_SPOTIFY_ID with your Spotify profile username (visible in your Spotify app under your profile). Linking the image to your Spotify profile lets visitors follow you or browse your public playlists — a nice community signal for developer profiles targeting creative or music-adjacent teams. Keep the image width constrained to 350px max for consistent rendering alongside stats cards.

Troubleshooting Spotify Now Playing

The most common issue is the widget showing 'Not Listening' even when music is playing. This usually means the refresh token has expired or was not saved correctly. Re-visit the /login endpoint on your Vercel deployment to regenerate a fresh token, then update the environment variable.

If the widget card fails to load entirely and shows a broken image, check that all three environment variables (Client ID, Client Secret, Refresh Token) are present in your Vercel project settings under Environment Variables. A missing variable causes the API to return a 500 error.

For CORS errors in local development, note that the widget is designed to run on Vercel, not locally — test changes by pushing to a preview deployment branch rather than running vercel dev.

Frequently Asked Questions

How do I add Spotify Now Playing to my GitHub README?

Fork the novatorem/novatorem repository, deploy it to Vercel with your Spotify API credentials as environment variables, complete the OAuth login flow to get your refresh token, then add the image markdown `[![Spotify](https://your-app.vercel.app/api/spotify)](https://open.spotify.com/user/YOUR_ID)` to your README. The setup takes about 15 minutes.

Is the Spotify Now Playing widget free to use?

Yes. The novatorem/novatorem project is open source under MIT license. Vercel's free tier is sufficient for personal use — the widget makes lightweight Spotify API calls and well within Vercel's free serverless function limits. The Spotify Developer API is also free for personal, non-commercial use.

Why is my Spotify Now Playing widget not showing up?

Check three things: (1) all environment variables are set in Vercel, (2) your refresh token is valid — regenerate it by visiting the /login endpoint, and (3) your Vercel deployment is active. GitHub occasionally caches images aggressively; add a `?cache=bust` query param if the card appears stale.

Does Spotify Now Playing work with private GitHub profiles?

The widget itself works regardless of your GitHub privacy settings, since it's hosted on Vercel and not a GitHub service. However, your Spotify account's listening history must be set to public in Spotify's privacy settings for the API to return currently playing data.

From Our Blog

Generate Your GitHub Profile README

Generate a GitHub profile README featuring Spotify Now Playing with AI

Try It Free — No Sign Up