Back to Dyrane Top 40

Autopilot Setup Guide

Configure your Spotify credentials to enable automatic weekly playlist updates.

Auto Updates

Fresh tracks every Friday at 9 AM UTC

Always Fresh

Trending Afrobeat from top artists

Secure

OAuth tokens stored safely

1Create a Spotify Developer App

  1. Go to the Spotify Developer Dashboard
  2. Log in with your Spotify account
  3. Click "Create app"
  4. Fill in the details:
    • App name: Dyrane Top 40 Autopilot
    • Redirect URI: http://localhost:3000/callback
    • Select Web API
  5. Click "Save"

2Get Your Client Credentials

  1. In your app settings, go to "Settings"
  2. Copy your Client ID
  3. Click "View client secret" and copy it
Environment Variables Needed:
SPOTIFY_CLIENT_ID=your_client_id
SPOTIFY_CLIENT_SECRET=your_client_secret

3Generate a Refresh Token

You need a refresh token with the correct scopes. Use this authorization URL (replace YOUR_CLIENT_ID):

https://accounts.spotify.com/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http://localhost:3000/callback&scope=playlist-modify-public%20playlist-modify-private%20playlist-read-private

After authorizing, you'll get a code in the URL. Exchange it for tokens using:

curl -X POST https://accounts.spotify.com/api/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "code=YOUR_CODE" \
  -d "redirect_uri=http://localhost:3000/callback" \
  -d "client_id=YOUR_CLIENT_ID" \
  -d "client_secret=YOUR_CLIENT_SECRET"
Environment Variable:
SPOTIFY_REFRESH_TOKEN=your_refresh_token

4Add Security Tokens

Generate secure random strings for the cron job and API protection:

SPOTIFY_PLAYLIST_ID=0pcWjkWSCyyftueBw4wEHs
CRON_SECRET=generate_a_random_32_char_string
UPDATE_API_KEY=generate_another_random_string

5Deploy to Vercel

  1. Add all environment variables in your Vercel project settings
  2. Deploy your project
  3. The cron job will automatically run every Friday!
Learn More About Vercel Cron Jobs

All Environment Variables

SPOTIFY_CLIENT_ID=your_client_id

SPOTIFY_CLIENT_SECRET=your_client_secret

SPOTIFY_REFRESH_TOKEN=your_refresh_token

SPOTIFY_PLAYLIST_ID=0pcWjkWSCyyftueBw4wEHs

CRON_SECRET=random_32_char_string

UPDATE_API_KEY=random_string_for_manual_updates