Automatically synchronize your BenchApp hockey schedule with Google Calendar using Google Apps Script. Perfect for busy hockey families who want all events in one place!
- π Automatic Syncing: Runs every 6 hours to keep calendars in sync
- π Full CRUD Support: Adds new events, updates changes, removes canceled games
- π« No Duplicates: Smart tracking prevents duplicate events
- βοΈ Configurable: Customize event prefixes, sync frequency, and date ranges
- π Detailed Logging: Clear logs for monitoring and troubleshooting
- π§ͺ Test Mode: Complete test suite for safe deployment
- Google account with access to Google Calendar
- BenchApp account with team calendar access
- 10 minutes for setup
-
Get Your BenchApp Calendar URL
- Open BenchApp mobile app or website
- Go to your team calendar
- Look for "Export" or "Subscribe" option
- Copy the calendar URL (looks like:
https://ics.benchapp.com/...)
-
Set Up Google Apps Script
- Go to script.google.com
- Create new project
- Copy the code from
src/hockey-sync.js - Update the configuration with your calendar details
-
Configure Your Settings
- Copy
src/config.jsto your Google Apps Script as a separate file - Update the configuration with your actual calendar details:
- Copy
const CONFIG = {
FAMILY_CALENDAR_ID: 'your-actual-calendar@gmail.com',
HOCKEY_CALENDAR_URL: 'https://ics.benchapp.com/your-actual-url',
EVENT_PREFIX: '[Hockey] ',
// ... other settings
};- Initialize
setupSync(); // One-time setup setupTriggers(); // Enable automatic syncing
Hockey families know the struggle:
- β Game schedules in BenchApp
- β Family events in Google Calendar
- β Constantly copying events between calendars
- β Missing games because they weren't in the family calendar
This script solves that by automatically keeping everything in sync!
- Fetches hockey schedule from BenchApp's ICS feed
- Compares with existing events in your Google Calendar
- Syncs changes (new events, updates, deletions)
- Repeats automatically every 6 hours
- Hockey parents managing family schedules
- Players who want all events in one calendar
- Teams wanting to share schedules with families
- Anyone using BenchApp + Google Calendar
| BenchApp Event | Google Calendar Result |
|---|---|
| New game added | β Event created with [Hockey] prefix |
| Time changed | π Existing event updated |
| Game canceled | ποΈ Event removed from calendar |
| Location updated | π Location synced automatically |
const CONFIG = {
FAMILY_CALENDAR_ID: '', // Target Google Calendar
HOCKEY_CALENDAR_URL: '', // BenchApp ICS URL
EVENT_PREFIX: '[Hockey] ', // Prefix for hockey events
DAYS_LOOKBACK: 7, // How far back to sync
DAYS_LOOKAHEAD: 90, // How far forward to sync
};
## π File Structure
src/
βββ hockey-sync.js # Main sync logic
βββ config.js # Configuration template (update with your values)
**For Google Apps Script:**
- Create two files: `Code.gs` (main script) and `config.gs` (your configuration)
- Keep your real calendar IDs in the config file onlyFixed in v1.2: Improved description handling to prevent false positive updates due to UID-only descriptions.
The script includes 300ms delays between calendar operations to prevent Google's rate limits.
Fixed in v1.2.1: Location fields now properly unescape ICS formatting characters (\n, \,) so addresses display correctly and link to Google Maps.
Critical Fix in v1.3.1: Added error handling to prevent data loss when BenchApp servers are unavailable. The script now fails safely rather than deleting events when it cannot fetch data.
Symptoms: Script removes all hockey events after a 504 or other HTTP error Solution: Updated error handling prevents sync when source data is unavailable
Contributions welcome! Please feel free to submit a Pull Request.
- Support for multiple teams/calendars
- Slack/Discord notifications for schedule changes
- Integration with other sports apps
- Custom event formatting options
MIT License - see LICENSE file for details.
If this saved you time, please star the repository!
Found a bug? Open an issue
Made with β€οΈ by a hockey parent tired of copying calendar events manually
Created by shahamish with assistance from Claude AI.