A simple web app to display your current Spotify playback, built with vanilla JS, Tailwind CSS, and the Spotify Web API.
- Spotify OAuth Login (PKCE flow, no backend required)
- Displays current track (title, artist, album, album art)
- Playback controls (play, pause, next, previous) for Spotify Premium users
- Responsive, modern UI using Tailwind CSS and Font Awesome icons
- Shows playback progress bar
- Profile picture and user info
- Spotify account (Premium required for playback controls)
- Modern browser (uses ES modules and Fetch API)
-
Clone this repo:
git clone https://github.com/bckelley/spotify-player.git cd spotify-player -
Set up a Spotify Developer App:
- Go to Spotify Developer Dashboard
- Create an app and set the Redirect URI to your local/test URL (e.g.
http://localhost/spotify/) - Copy your Client ID and update it in
spotify-api.jsandauth.jsif needed.
-
Run locally:
- Place the project in your local web server root (e.g.
c:\laragon\www\spotify) - Open
http://localhost/spotify/in your browser
- Place the project in your local web server root (e.g.
-
Login with Spotify:
- Click the "Login with Spotify" button and authorize the app.
index.html # Main UI
main.js # App logic and UI updates
spotify-api.js # Spotify API and OAuth logic
auth.js # (Optional) Separate auth logic
ui.js # UI helper functions
pkce.js # PKCE utility functions
- Styling: Uses Tailwind CSS via CDN for rapid styling.
- Icons: Uses Font Awesome for playback controls.
- Profile: Shows your Spotify profile picture if available.
- Playback controls (play, pause, next, previous) require a Spotify Premium account.
- The app polls the Spotify API every 2 seconds for updates.
- No backend server is required; all logic runs in the browser.
Built by bckelley · Source