SBC(Seattle Badminton Club) Ladder Registration Guide

This guide explains how to set up automated registration for SBC Ladder badminton events using Val.Town.

https://sbc-ladder.kgignatyev.com/

Obtaining Authentication Credentials

Getting Your Bearer Token

  1. Open Chrome and navigate to the SBC Ladder application
  2. Open Chrome Developer Tools (Right-click → Inspect or Ctrl+Shift+I / Cmd+Option+I)
  3. Go to the "Network" tab and filter for "token"
  4. Log in to the SBC Ladder application
  5. Find the request to https://sbc.us.auth0.com/oauth/token
  6. In the response, copy the id_token value - this is your bearer token

Finding Partner IDs

  1. Ask your partner to visit the SBC Ladder site and check their network tab
  2. Look for a request to https://sbc-ladder.kgignatyev.com/badminton/api/v1/members/myself
  3. The response will contain their member ID in the format like "7_1713"

Setting Up on Val.Town

  1. Log in to your Val.Town account
  2. Go to Settings → Environment Variables (https://val.town/settings/environment-variables)
  3. Add two environment variables:
    • SBC_TOKEN: Paste your bearer token here
    • SBC_PLAYER_2_ID: Paste your partner's ID here

Scheduling the Registration Script

  1. Create a new val with the provided SBC Ladder Client code
  2. Set the cron expression to */15 * * * 3 to run every 15 minutes on Wednesdays

Troubleshooting

  • Tokens expire after 24 hours - update your SBC_TOKEN regularly
  • Check the logs in Val.Town to see any error messages
  • Verify your partner's ID is correct and active in the system

Remember that your environment variables are private, even if your val is public. The script will automatically use these variables when it runs.