Skip to content

Latest commit

 

History

History
74 lines (58 loc) · 2.4 KB

File metadata and controls

74 lines (58 loc) · 2.4 KB

Detailed Setup Guide

Step 1: Find Your BenchApp Calendar URL

Method 1: Mobile App

  1. Open BenchApp on your phone
  2. Go to your team's calendar
  3. Tap the share or export icon
  4. Look for "Subscribe to Calendar" or "Export Calendar"
  5. Copy the URL (starts with https://ics.benchapp.com/)

Method 2: Web Browser

  1. Go to BenchApp website and log in
  2. Navigate to your team calendar
  3. Look for calendar export/subscribe options
  4. Copy the ICS URL

Step 2: Find Your Google Calendar ID

  1. Open Google Calendar in web browser
  2. Go to Settings (gear icon) → Settings
  3. Select your family calendar from the left sidebar
  4. Scroll down to "Calendar ID"
  5. Copy the entire calendar ID (usually ends with @group.calendar.google.com)

Step 3: Set Up Google Apps Script

  1. Go to script.google.com
  2. Click "New Project"
  3. Create Configuration File:
    • Click the "+" next to Files
    • Choose "Script" and name it config
    • Copy the contents of src/config.js from this repository
    • Update with your actual calendar details
  4. Add Main Script:
    • In the default Code.gs file, delete the default code
    • Copy and paste the code from src/hockey-sync.js
  5. Save the project (Ctrl+S)

Step 4: Test and Deploy

  1. Run setupSync() function first
  2. Check the execution log for errors
  3. Verify events appear in your Google Calendar
  4. Run setupTriggers() to enable automatic syncing

Troubleshooting

"Calendar not found" error

  • Double-check your calendar ID
  • Make sure the calendar is shared with your Google account

"Cannot access hockey calendar URL" error

  • Verify the BenchApp URL is correct
  • Check if you're logged into BenchApp
  • Try accessing the URL directly in a browser

No events syncing

  • Check if there are upcoming events in BenchApp
  • Verify the date range settings (DAYS_LOOKBACK/DAYS_LOOKAHEAD)
  • Look at the execution logs for detailed error messages

Advanced Troubleshooting

Server Errors (504, 503, etc.)

If BenchApp's servers are temporarily down, the script will safely abort the sync rather than delete existing events. Check the execution logs for HTTP error codes.

Testing Configuration

Run this function to verify your config is loaded correctly:

function testConfig() {
  console.log('FAMILY_CALENDAR_ID:', CONFIG.FAMILY_CALENDAR_ID);
  console.log('HOCKEY_CALENDAR_URL:', CONFIG.HOCKEY_CALENDAR_URL);
}