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
- Open Chrome and navigate to the SBC Ladder application
- Open Chrome Developer Tools (Right-click → Inspect or Ctrl+Shift+I / Cmd+Option+I)
- Go to the "Network" tab and filter for "token"
- Log in to the SBC Ladder application
- Find the request to
https://sbc.us.auth0.com/oauth/token
- In the response, copy the
id_token
value - this is your bearer token
- Ask your partner to visit the SBC Ladder site and check their network tab
- Look for a request to
https://sbc-ladder.kgignatyev.com/badminton/api/v1/members/myself
- The response will contain their member ID in the format like "7_1713"
- Log in to your Val.Town account
- Go to Settings → Environment Variables (https://val.town/settings/environment-variables)
- 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
- Create a new val with the provided SBC Ladder Client code
- Set the cron expression to
*/15 * * * 3
to run every 15 minutes on Wednesdays
- 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.