- Runtime —
createCorsair(). Agents call Slack, GitHub, and the rest through this. - Management API — the routes behind a dashboard: list tenants, connect OAuth accounts, check plugin status, look up permissions.
mental-model.ts
corsair package root.
When to reach for it
- You are building a dashboard, an internal tool, or any UI that needs to see Corsair state from outside the agent runtime.
- You want a typed HTTP boundary between a frontend and your Corsair server instead of calling
corsair.*directly.
corsair.slack.api.* and friends.
The pieces
Handler
Mount the 9 management routes on any HTTP framework. Ships with Next.js, Express, and Hono adapters.
Vanilla client
createCorsairClient — typed fetch wrapper. Works in any JS runtime.React hooks
createCorsairReactClient — typed useTenants, useConnectionStatus, etc.Connect / OAuth
One
createLink API — hub or self-hosted, config-driven.End-to-end flow
server.ts
app/api/corsair/[...path]/route.ts
app/dashboard/page.tsx