Use this file to discover all available pages before exploring further.
By the end of this guide you’ll have a working Next.js app with a live Google Calendar dashboard — and you’ll have written almost none of the UI yourself.
Paste this before your feature prompt so the agent knows how Corsair works:
This app uses Corsair. Every Corsair plugin has two namespaces: corsair.<plugin>.db — reads from the local database (no network, instant) corsair.<plugin>.api — calls the live external APIBoth follow the same shape: corsair.<plugin>.[db|api].<group>.<method>(args)When to use which:- Rendering UI / reading data → .db (always the default)- Creating, updating, or deleting → .api- User-triggered refresh / sync → .api, then re-read from .db- Every .api response is auto-saved to .dbEntity data is on .data in camelCase. Use .search({}) or .list() on .db to query.To see what's available, run: pnpm corsair list --<plugin>
Corsair needs five tables. Install the driver, then run the migration:
npm install better-sqlite3
npm install --save-dev @types/better-sqlite3
View migration SQL
migration.sql
CREATE TABLE IF NOT EXISTS corsair_integrations ( id TEXT PRIMARY KEY, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL, name TEXT NOT NULL, config TEXT NOT NULL DEFAULT '{}', dek TEXT NULL);CREATE TABLE IF NOT EXISTS corsair_accounts ( id TEXT PRIMARY KEY, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL, tenant_id TEXT NOT NULL, integration_id TEXT NOT NULL, config TEXT NOT NULL DEFAULT '{}', dek TEXT NULL, FOREIGN KEY (integration_id) REFERENCES corsair_integrations(id));CREATE TABLE IF NOT EXISTS corsair_entities ( id TEXT PRIMARY KEY, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL, account_id TEXT NOT NULL, entity_id TEXT NOT NULL, entity_type TEXT NOT NULL, version TEXT NOT NULL, data TEXT NOT NULL DEFAULT '{}', FOREIGN KEY (account_id) REFERENCES corsair_accounts(id));CREATE TABLE IF NOT EXISTS corsair_events ( id TEXT PRIMARY KEY, created_at INTEGER NOT NULL, updated_at INTEGER NOT NULL, account_id TEXT NOT NULL, event_type TEXT NOT NULL, payload TEXT NOT NULL DEFAULT '{}', status TEXT, FOREIGN KEY (account_id) REFERENCES corsair_accounts(id));
Google Calendar uses OAuth2. You’ll need a GCP OAuth app first:
Go to the Google Cloud Console, create a project, and enable the Google Calendar API.
Under APIs & Services → Credentials, create an OAuth 2.0 Client ID (Application type: Web application). No redirect URI needed — Corsair handles it locally.
Copy your Client ID and Client Secret, then store them:
Paste this prompt into Claude, Cursor, or any AI coding agent:
I have a Next.js T3 app. The Google Calendar plugin is connected via Corsair.Build me a Google Calendar dashboard on the home page. I want to see:- A stats row showing: how many events I have today, how many this week, what my next meeting is, and how many hours are blockedtoday- Today's full agenda — all my events for today in order with times and titles- An upcoming events panel — my next couple weeks of events grouped by day- A Create Meeting button that opens a form to schedule a new event- A notes field on each meeting card where I can save and edit private notes per event (store these in a local table, not on GoogleCalendar)- A Refresh button in the header that fetches the latest events from Google Calendar and updates what's shown on screen, includingremoving any events the user has deleted from Google CalendarThe app should use await corsair.googlecalendar.db as a cache — load from there first, and only call Google Calendar when the data isn'tcached yet, when creating an event, or when the user clicks Refresh. The page should not make any live API calls on its own afterthe first load.