> For the complete documentation index, see [llms.txt](https://docs.kinwall.family/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kinwall.family/connecting-calendars/google.md).

# Google

Google calendars sync **two-way**: events you create, edit or delete in Kinwall are written to Google first. If Google refuses a write, nothing is saved in Kinwall and you see the error.

## 1. Create an OAuth client

You can do this entirely in the UI, with no restart. On an admin device, open **Settings → Calendars → Calendar providers**:

1. Check **Public URL**. It's pre-filled from the page's own address and used to build the redirect URI.
2. Open the **Google** card. It shows the exact **Redirect URI** (`<public URL>/api/oauth/google/callback`) with a copy button, plus these steps:
   1. In Google Cloud Console, create an OAuth client of type "Web application".
   2. Add the redirect URI to its Authorized redirect URIs.
   3. Enable the Google Calendar API for the project.
   4. If the consent screen is in Testing, add yourself as a test user.
3. Paste the **Client ID** and **Client secret**, then **Save**. **Test sign-in** tries the flow.

Or set `GOOGLE_CLIENT_ID` / `GOOGLE_CLIENT_SECRET` as environment variables. A client configured in the UI wins over the variables. When only the variables configure it, the card shows "Provided by your host" and is read-only.

**Google requires HTTPS or `localhost` redirect URIs.** A bare LAN IP like `http://192.168.1.10:8080` won't work. Use Workers, a domain with HTTPS, or finish sign-in from `http://localhost:8080` on the server itself.

## 2. Connect an account

**Settings → Calendars → Connect Google** (greyed out until a client is configured). After you consent, you land back on **Calendars for&#x20;*****account***, where you tick the calendars to show (and who each is for), then tap **Add N calendars**. Tapping outside the sheet doesn't close it; use **Cancel**. Calendars you can't write to are marked **read-only**.

## Scopes and tokens

Kinwall asks only for `calendar.events`, `calendar.readonly`, `openid` and `email`, not full calendar access. The flow uses PKCE and a single-use state. The refresh token is encrypted at rest. Removing the account revokes the Google token (best effort) and deletes its calendars from Kinwall. Nothing is deleted in Google.

## Reminders

Reminders you set in Kinwall are written to the Google event as popup reminders. **Google calendar default** writes "use the calendar's default" back. See [Events → Reminders](/using-kinwall/events.md#reminders).

## Tip: read-only without OAuth

If you only need to *see* a Google calendar, use its **secret address in iCal format** as an [ICS feed](/connecting-calendars/ics-feeds.md). No OAuth client is needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.kinwall.family/connecting-calendars/google.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
