CalSnap serves custom team calendar that are more detailed, clear, and usable. CalSnap deploys as a Cloudflare Worker (serverless function), connects to your TeamSnap account, and serves .ics iCalendar subscriptions for each team.
“TeamSnap already has calendars! Why use this?”
While TeamSnap supports calendar subscriptions, events lack useful information, team names are too long, and descriptions are messy.
CalSnap uses the TeamSnap API so that your calendars include:
- a custom team name (shorter or more descriptive)
- links to individual TeamSnap event pages
- arrival times (minutes early)
- event notes by team manager or coach
Try the CalSnap settings demo to see how you can customize your TeamSnap team calendars:
| CalSnap | TeamSnap |
| Leafs vs. Forest Hill Knights | North Toronto Leafs 2014 U12 AAA… |
| Leafs vs. East York Lynx | North Toronto Leafs 2014 U12 AAA… |
| Leafs: Game | North Toronto Leafs 2014 U12 AAA… |
| CalSnap | TeamSnap |
|
Leafs vs. Forest Hill Knights GitHub Arena 101 Command Line Ave. |
North Toronto Leafs 2014 U12 AAA… 101 Command Line Ave. |
|
Away at Forest Hill Knights Uniform: White GitHub Arena Rink B Arrival: 1:20 PM · 40 min. Notes: limited parking TeamSnap event page link |
Location: GitHub Arena - Rink B Uniform: White (Arrival Time: 1:20 PM (Eastern Time (US & Canada))) |
- Workers & Pages ⇢ Create an application ⇢ Clone a repository
- Git repository URL:
http://github.com/andesco/calsnap
-
Create a Cloudflare Workers KV namespace with Wrangler CLI and note the new namespace ID:
git clone https://github.com/andesco/calsnap.git cd calsnap wrangler kv namespace create "CALSNAP_CALENDAR_STORE"
-
Update
wrangler.tomlwith the new KV namespace ID and set your environment variables:[[kv_namespaces]] binding = "CALSNAP_CALENDAR_STORE" id = "{new KV namespace ID}"
-
Deploy with Wrangler CLI:
wrangler deploy
Note
Note the URL of your new worker:
https://calsnap.{subdomain}.workers.dev
-
TeamSnap authentication ⇢ Your Account ⇢ Your Applications ⇢ New Application
-
Name:
TeamSnap Custom Calendar
Description:Cloudflare Worker
Redirect URI:https://calsnap.{subdomain}.workers.dev -
Client ID:
{your Client ID}
Client Secret:{your Client Secret}
- Workers & Pages ⇢
{worker}⇢ Settings: Variables and Secrets: Add: - Type:
Text
Variable name:TEAMSNAP_CLIENT_ID
Value:{your Client ID} - Type:
Secret
Variable name:TEAMSNAP_CLIENT_SECRET
Value:{your Client Secret}
- set your environment variables
wrangler.toml:[vars] ALLOWED_USER_EMAIL = "{your TeamSnap email}" TEAMSNAP_CLIENT_ID = "{your Client ID}"
- Set your secrets with Wrangler CLI:
wrangler secret put TEAMSNAP_CLIENT_SECRET
- Open your Cloudflare Worker in a browser:
https://calsnap.{subdomain}.workers.dev - Authenticate with TeamSnap.
ALLOWED_USER_EMAIL- Plain Text
- TeamSnap email address authorized to use this calendar service. Only this user can access the service.
TEAMSNAP_CLIENT_ID- Plain Text
- lient ID from your TeamSnap OAuth application.
TEAMSNAP_CLIENT_SECRET- Encrypted Secret
- Client Secret from your TeamSnap OAuth application.
CalSnap automatically caches calendar data for 1 hour to improve performance and reduce API calls. You can control caching behavior with URL query parameters:
-
?cache=off
bypass reading from cache (still writes new data to cache) -
?refresh=true
force cache refresh (clears old cache and regenerates)
Tip
Use refresh=true when you need fresh data immediately after making changes in CalSnap or TeamSnap.
CalSnap includes go.teamsnap.com links in calendar events that should open in the TeamSnap mobile app via Universal Links (iOS) or App Links (Android).
According to TeamSnap’s app association configuration (apple-app-site-association), these URL patterns are supported:
https://go.teamsnap.com/PodAccess/*https://go.teamsnap.com/{teamId}/home/https://go.teamsnap.com/{teamId}/assignments/https://go.teamsnap.com/{teamId}/roster/https://go.teamsnap.com/paywall*https://go.teamsnap.com/tab/contenthttps://go.teamsnap.com/content/item
These patterns are not fully supported by TeamSnap mobile apps. Based on testing, the TeamSnap app:
- will open when clicking these links;
- will not navigate to the specified team, tab, or event.
CalSnap uses event-specific URLs in the format:
https://go.teamsnap.com/{teamId}/schedule/view_event/{eventId}
This link will open the specified event in a browser, but not in the TeamSnap app. This is a limitation of TeamSnap’s current deep linking implementation.