A lightweight Node.js server that generates a dynamic image of your currently playing Spotify track,
perfect for embedding in GitHub READMEs, websites, or anywhere that accepts image URLs.
- 🎵 Real-time display of currently playing Spotify track
- 🖼️ Beautiful album artwork with rounded corners
- 🔄 Automatic fallback to recently played track when nothing is playing
- 🚀 Lightweight Node.js server
- 🔒 Secure authentication with Spotify API
- 💫 Cache-busting headers for always-fresh images
- 🎨 Clean, modern design
- Node.js 18 or higher
- npm (Node.js package manager)
- A Spotify Developer account
git clone https://github.com/OMetaVR/ReadMe-RPCs.git
cd spotify-done-rightnpm install- Go to the Spotify Developer Dashboard
- Log in with your Spotify account
- Click "Create an App"
- Fill in the app name and description
- Once created, click "Settings"
- Add
http://localhost:3000/callbackto the Redirect URIs and save
- Create a
.envfile in the root directory with your Spotify credentials:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret
PORT=3002- Run the token generator:
node get-refresh-token.js- Visit http://localhost:3000/login in your browser
- Authorize the application
- Copy the refresh token and add it to your
.envfile:
SPOTIFY_REFRESH_TOKEN=your_refresh_tokennode src/index.jsYour Now Playing image will be available at:
http://localhost:3002/nowplaying.png
For 24/7 availability, deploy to a hosting service like:
Make sure to:
- Set all environment variables on your hosting platform
- Update the image URL in your README/website to point to your deployed server
Add this to your README.md (replace the URL with your server's URL):
Note: The ?t={timestamp} parameter helps prevent GitHub's image caching. You might want to use a GitHub Action to automatically update this timestamp periodically.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Unlicensed License. See the LICENSE file for details.
- Spotify Web API
- sharp for image processing
- express for the web server
