Connect ESPN

Configure your ESPN Fantasy Basketball credentials

ESPN Authentication

Adam uses your ESPN session cookies to access your private league data. Your credentials are never logged or stored insecurely.

How to get your ESPN cookies:

  1. Log in to ESPN Fantasy
    Go to fantasy.espn.com/basketball and sign in
  2. Open Developer Tools
    Press F12 or right-click → Inspect → Application tab
  3. Find Cookies
    In the sidebar: Storage → Cookies → https://fantasy.espn.com
  4. Copy these values:
    espn_s2 - A long string (your session cookie)
    SWID - A GUID in braces like {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
  5. Get your League ID
    From your league URL: fantasy.espn.com/basketball/league?leagueId=12345678

Environment Variables

Add these to your Vercel project settings or .env.local file:

# ESPN Fantasy (Required)
ESPN_S2=your_espn_s2_cookie_value
ESPN_SWID={XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}
ESPN_LEAGUE_ID=12345678
ESPN_SEASON=2026
ESPN_MY_TEAM_ID=1

# Telegram Notifications (Optional)
TELEGRAM_BOT_TOKEN=your_bot_token
TELEGRAM_CHAT_ID=your_chat_id

# Vercel KV (Auto-configured on Vercel)
KV_URL=your_kv_url
KV_REST_API_URL=your_kv_rest_api_url
KV_REST_API_TOKEN=your_kv_rest_api_token
KV_REST_API_READ_ONLY_TOKEN=your_read_only_token

# Optional
APP_BASE_URL=https://your-app.vercel.app
CRON_SECRET=your_cron_secret

Telegram Notifications

How to set up Telegram alerts:

  1. Create a Telegram Bot
    Message @BotFather on Telegram and send /newbot
  2. Save the Bot Token
    BotFather will give you a token like 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ
  3. Get Your Chat ID
    Start a chat with your bot, then visit:
    https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
    Find your chat ID in the response
  4. Add to Environment Variables
    Set TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID

Vercel Deployment

  1. Fork or Clone the Repository
  2. Create a Vercel KV Store
    In your Vercel project: Storage → Create Database → KV
  3. Add Environment Variables
    Project Settings → Environment Variables → Add all variables above
  4. Deploy
    Push to your repository or deploy via Vercel CLI
  5. Verify Cron Job
    Check Vercel Dashboard → Settings → Cron Jobs