How Calendar Sync Actually Works
A technical look at how MochiMeet keeps your availability accurate in real-time.
The Challenge
Calendar sync sounds simple: read events from your calendar, show available slots, done. In practice, it's surprisingly complex.
Here's what we're actually solving:
How MochiMeet Handles It
Step 1: OAuth Connection
When you connect your Google or Microsoft account, we request specific scopes:
We never see event titles or descriptions—just the time blocks that are busy.
Step 2: Availability Calculation
When someone visits your booking page, we:
This all happens in real-time, every time someone loads your page.
Step 3: Conflict Prevention
Between loading slots and confirming a booking, things can change. Someone might book a slot on your calendar directly.
We handle this with a double-check at booking time:
Timezone Magic
Timezones are notoriously tricky. Here's our approach:
This ensures a guest in Tokyo sees the correct times when booking with a host in New York.
The Provider Abstraction
Internally, we use a `CalendarProvider` interface:
interface CalendarProvider {
listCalendars(): Promise<Calendar[]>
getBusyIntervals(start: Date, end: Date): Promise<Interval[]>
createEvent(event: EventInput): Promise<Event>
}
This abstraction lets us support Google, Microsoft, and potentially other providers with consistent behavior.
What's Next
We're working on:
Questions about how something works? [Reach out](/support)—we love nerding out about this stuff.