> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Calendar event sync

> Mount Google Calendar event sync.

Follow the [REST app guide](https://docs.bijection.com/integrations/native-rest.md#mount-and-bind).
Use `providerEndpoint` from `@bijectionhq/app-rest` to bind the collection,
and supply Google OAuth `calendar.events.readonly`.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
const provider = providerEndpoint(
  "google-calendar/events.sync",
  "https://www.googleapis.com",
  "/calendar/v3/calendars/primary/events",
  auth,
  data,
);
```

Pass `provider` as `receivers.provider`, with the same label to the binder and as the app's `data`. Grant the app's `operator` role, then call
`source.initialize` with this profile.

```ts theme={"theme":{"light":"github-light-default","dark":"github-dark-default"}}
{ profile: { mode: "provider", provider: "google-calendar/events.sync", limit: 25 } }
```

Bind one calendar. Replace `primary` with its URL-encoded calendar ID to select another. The event ID keys each row. Recurring masters and exceptions stay distinct, and cancellations are retained as status-bearing observations. In a paged walk the current sync token is repeated with the page token. The terminal sync token becomes the next poll's start. HTTP 410 with a retained position requires an explicit baseline reset. Rows absent in the replacement baseline stay published.

Up to 100 rows and 36 KiB per response. The bundled parser is required. Pages publish rows and their next
position together. Use [source health and controls](https://docs.bijection.com/integrations/native-rest.md#feed-contracts)
to review failures and recover the feed.

[Provider API reference](https://developers.google.com/workspace/calendar/api/v3/reference/events/list)

## Write events

Follow the [native write app guide](https://docs.bijection.com/integrations/native-rest.md#native-provider-writes). Bind `providerWriter("google-calendar.events.create-update-delete", { endpoint: "https://www.googleapis.com", auth }, data)` and pass it as `receivers.writers["google-calendar.events.create-update-delete"]`. Seal a user OAuth credential with Calendar event write scope. The fixed collection is the authenticated user’s primary calendar. Send one event object. HTTP 200 must return the event ID on create and update. Delete accepts HTTP 204 for the requested event. Use a recurring instance’s exact ID to address that instance.

The writer records its evidence under the app's `data` label. Commands take up to 24 KiB of JSON and carry no read cursor.

[Provider write API](https://developers.google.com/workspace/calendar/api/v3/reference/events)

## Expand a recurring event

Use mode `google-calendar.event.instances.observations` on a separate
REST mount with a protected `data` label. Bind `providerEndpoint` to
`https://www.googleapis.com` and
`/calendar/v3/calendars/CALENDAR_ID/events/EVENT_ID/instances`. Use a
sealed bearer or OAuth2 credential with event read access to the calendar.

Set `start` and `end` to UTC timestamps at second precision, spanning up
to 366 days. The provider uses the start as an inclusive bound on event
end and the end as an exclusive bound on event start. The same window is
sent with each page token. Instances are keyed by event ID, including
cancelled instances with their status. Missing instances stay published.
Each answer accepts up to 100 rows and 36 KiB. A terminal page restarts
the bounded sweep on the next poll.

[Recurring event instances](https://developers.google.com/workspace/calendar/api/v3/reference/events/instances)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.