Skip to main content

Authorization

This page is reference material. For the operator workflow, use How to sync content with Google Calendar.
The deployment-wide OAuth client uses GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET. Reauthorization preserves the stored calendar identity and an existing refresh token when the token response omits one.

API routes

GET /api/calendar/google

Returns the active workspace’s connection state.
Expired credentials are not reported as connected.

App-created calendar

The first sync provisions a secondary calendar named Harmonia Content Calendar. Firestore records a provisioning claim before calling Google. An ambiguous create is intentionally not retried because Google Calendar does not accept a client-selected calendar ID.
An uncertain provisioning claim is fail-closed state, not an instruction to retry. Inspect the Google account before changing or reconnecting the integration.

Event projection

The deterministic event ID makes inserts retry-safe. A 409 after an ambiguous insert converges only when strict read-back matches the intended event. Updates use the current Google ETag in If-Match. A 412 after an ambiguous update converges only when strict read-back matches; otherwise the operation fails visibly.

Persisted sync state

ContentItem.googleCalendarSync contains: Failure state preserves the previous ETag, link, source revision, and verification timestamp. If content changes concurrently with a successful sync, persistence records update_required; a verified removal remains removed.

Retry and verification rules

  • Network failures, 429, and 5xx responses receive at most three bounded attempts on convergence-safe requests.
  • Calendar provisioning receives one attempt and locks on an uncertain outcome.
  • Validation, authorization, permission, and ordinary conflict failures are not retried.
  • A sync is successful only when events.get matches ID, summary, description, start, end, transparency, and private properties.
  • A removal is successful only when events.get reports 404 or 410.
  • Offline tests do not prove a live Google account, valid consent screen, deploy-time credentials, or provider availability.

Live evidence checklist

See the exact artifacts required before presenting Google Calendar synchronization as live hackathon evidence.
Last modified on August 25, 2026