🟢 Spotify Integration Setup

Connect nJukebox with Spotify for streaming music

Prerequisites: You need a Spotify Premium account to use the streaming features. Free accounts are not supported by Spotify's Web Playback SDK.
Widevine DRM Required: Your browser must support Widevine DRM for Spotify integration to work. Modern browsers like Chrome, Firefox, Safari, and Edge support this by default. Older browsers or special configurations might have Widevine disabled, which will prevent Spotify playback.

Step 1: Create a Spotify App

  1. Go to the Spotify Developer Dashboard
  2. Log in with your Spotify account
  3. Click "Create App"
  4. Fill in the app details:
    • App name: nJukebox (or any name you prefer)
    • App description: Digital jukebox system
    • Website: http://localhost:3000 (or your domain)
    • Redirect URI: http://localhost:3000/spotify_login.html
  5. Accept the Terms of Service
  6. Click "Save"
📝 Example App Settings:
Name: nJukebox
Description: Digital jukebox with local and streaming music
Redirect URI: http://localhost:3000/spotify_login.html

Step 2: Get Your Client ID

  1. After creating the app, you'll see your app dashboard
  2. Click on your app name to view details
  3. Find the "Client ID" in the app settings
  4. Copy this Client ID (you'll need it in the next step)
Security Note: The Client ID is public and safe to share. Do NOT use or share the Client Secret for web applications.

Step 3: Configure nJukebox

  1. Start nJukebox and open the web interface
  2. Click the lock icon (🔒) and enter your admin PIN
  3. In the admin panel, click "⚙️ Konfiguration" next to Spotify settings
  4. Paste your Client ID in the input field
  5. Click "Speichern" (Save)
Configuration Complete! nJukebox is now configured to work with Spotify.

Step 4: Connect Your Spotify Account

  1. In the admin panel, click "Mit Spotify verbinden"
  2. You'll be redirected to Spotify's authorization page
  3. Log in with your Spotify Premium account
  4. Grant the requested permissions:
    • Read your currently playing track
    • Control playback on your devices
    • Access your email and profile
  5. You'll be redirected back to nJukebox
  6. The Spotify status should show as connected (green dot)

Required Spotify Permissions

nJukebox requests the following Spotify scopes:

  • user-read-playback-state - Read your current playback state
  • user-modify-playbook-state - Control your playback
  • user-read-currently-playing - Read currently playing track
  • streaming - Play music on supported devices
  • user-read-email - Access your email address
  • user-read-private - Access your profile information

Using Spotify Features

Searching Spotify

Once connected, the search function will include Spotify results alongside your local music library.

Playing Spotify Tracks

  1. Search for any track, artist, or album
  2. Spotify results will show with a 🌐 badge
  3. Click any Spotify track to add it to your playlist
  4. The track will play through nJukebox

Mixed Playlists

You can create playlists that mix local MP3 files with Spotify tracks seamlessly.

Troubleshooting

Connection Issues

Common Issues:
  • Redirect URI mismatch: Ensure the redirect URI in your Spotify app matches exactly: http://localhost:3000/spotify_login.html
  • Free account: Spotify Premium is required for playback features
  • Browser blocking: Ensure popups are allowed for the nJukebox domain

Playback Issues

  • No audio: Check that your browser allows audio playback
  • Track skipping: Ensure you have a stable internet connection
  • Authorization expired: Re-authorize in the admin panel if connection is lost
  • Widevine DRM: Verify that Widevine DRM is enabled in your browser (chrome://settings/content/protectedContent or about:preferences#privacy in Firefox)

Token Refresh

Spotify tokens expire after 1 hour. nJukebox automatically refreshes them, but if you encounter authorization errors:

  1. Go to the admin panel
  2. Click the Spotify configuration button
  3. Re-authorize your account

Advanced Configuration

Custom Domain Setup

If you're running nJukebox on a custom domain:

  1. Update your Spotify app's redirect URI to: https://yourdomain.com/spotify_login.html
  2. Ensure your domain uses HTTPS (required by Spotify)
  3. Update the website URL in your Spotify app settings

Multiple Instances

To run multiple nJukebox instances:

  • Create separate Spotify apps for each instance
  • Use different ports and redirect URIs
  • Configure each instance with its own Client ID
Next Steps: Learn about admin features and how to manage events with Spotify integration.