Skip to main content
Corsair has two surfaces:
  • RuntimecreateCorsair(). 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.
If you self-host Corsair and want your own dashboard, the management API is what you mount. The shape mirrors better-auth:
mental-model.ts
All of these (except the React hooks) are exported from the 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.
If you only run agents server-side, you don’t need this — keep using corsair.slack.api.* and friends.

The pieces

Handler

The 9 management routes, options, and error shapes. Mounting lives under 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
That is the whole picture. The next pages cover each layer in detail.

Auth

The management API has no auth opinion. Wire your own — NextAuth, Clerk, an API key check, whatever already protects the rest of your dashboard. Put it in front of the handler:
Corsair will not block you, prompt you, or guess. That is intentional.