MIT LicenseBuilt for apps and AI agents that use Google Calendar

Google Calendar API on localhost

Calendarpit serves a Google Calendar API v3 subset, local OAuth, and an admin UI in one process. Test with no Google account or network access.

Your app

Google SDKs and tests

Google Calendar

Not needed

  • OAuth sign-in
  • Events
  • Recurrence
  • Free/busy
  • Sync
  • Webhooks

Calendarpit

Local server

Why Calendarpit

Building apps and AI agents that use Google Calendar means setting up OAuth and preparing test data. With a live calendar, repeating a test from the same state can be hard. Calendarpit lets you test locally with fixtures and no Google credentials.

Testing with real Google

  • Needs a Google account, Cloud project, and OAuth setup.
  • Depends on internet access and shared API quotas.
  • Shared calendar data changes between test runs.

Testing with Calendarpit

  • Sign in as a local test user with no real credentials.
  • Runs on 127.0.0.1 in one process with no network access.
  • Seed data from fixtures and reset state between tests.

How it works

Start Calendarpit

One process serves the API, local OAuth, and the admin UI on http://127.0.0.1:4173.

docker run --rm -p 127.0.0.1:4173:4173 ghcr.io/iktakahiro/calendarpit:latest
brew install iktakahiro/tap/calendarpit
calendarpit serve

Point your app to Calendarpit

Keep your Google SDK and override its OAuth and API endpoints. For example, with @googleapis/calendar and google-auth-library:

const origin = 'http://127.0.0.1:4173';
const auth = new OAuth2Client({
  clientId: 'sample-app',
  clientSecret: 'local-sample-secret',
  redirectUri: 'http://127.0.0.1:4175/callback',
  endpoints: {
    oauth2AuthBaseUrl: `${origin}/oauth/authorize`,
    oauth2TokenUrl: `${origin}/oauth/token`,
  },
});
const api = calendar({ version: 'v3', auth, rootUrl: origin });

For every available endpoint, see Connect your app. To set up the SDK in Python, Go, or another language, see SDK examples.

Test with fixtures

Reset to the startup fixture before each test, and inspect requests in the admin UI.

curl -X POST http://127.0.0.1:4173/__calendarpit/reset \
  -H "Content-Type: application/json" \
  -d '{}'

Inside the admin UI

The admin UI is served on the same origin as the API (http://127.0.0.1:4173/). Open it in the browser while your app runs to check events written through the Calendar API, inspect requests and webhook deliveries, and edit test data between runs.

  1. Schedule

    Events your app creates or updates appear immediately. Edit them here to set up test data.

  2. API history

    Every Calendar API and OAuth request, with its status, headers, and body. Filter for errors to see why a call failed.

  3. Watch

    Active watch channels and each webhook delivery, with its attempt count and the HTTP status your endpoint returned.

  4. Connections

    OAuth grants by test user, client, and scope. Revoke one to test how your app handles reauthorization.

What Calendarpit includes

Start building calendar apps with Calendarpit

Calendarpit is built for local development and automated tests only. It implements a defined subset of the Google Calendar API v3 on loopback.