MIT LicenseBuilt for apps and AI agents that use Google Calendar
Google Calendar API on localhost
Calendarpit serves a Google Calendar API v3 subset and local OAuth in one process. Test with no Google account or network access.
127.0.0.1:4173Your app
Google SDKs and tests
Google Calendar
Not needed
- OAuth sign-in
- Events
- Recurrence
- Free/busy
- Sync
- Webhooks
Calendarpit
Local server on 127.0.0.1
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.
brew install iktakahiro/tap/calendarpit
calendarpit servedocker run --rm -p 127.0.0.1:4173:4173 ghcr.io/iktakahiro/calendarpit:latestPoint 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 });Connect your app covers every endpoint, and SDK examples cover Python, Go, Java, and .NET.
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 '{}'What Calendarpit includes
Google Calendar API
Calendars, events, recurring events, free/busy, and incremental sync in API v3 shapes.
Local OAuth sign-in
Pick a test user on the local consent page to issue and refresh tokens with no passwords.
Fixtures and reset
Seed users, calendars, events, and clients from a fixture, then reset between test runs.
Watch webhooks
Send events.watch notifications to local callbacks, and drain deliveries from tests.
Admin UI
Inspect and edit users, calendars, and events in the browser, and read the request history.
Explicit about gaps
Unsupported features fail with HTTP 501 (unsupportedFeature), never a silent wrong answer.
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.