Prefer to hand this to a coding agent? Point it at this page: “Set up Corsair Hub in this app. Follow https://docs.corsair.dev/hub/setup.md end to end.” It works through the same five steps below.
Prerequisites
A Hub project. Open your project’s Keys tab in the dashboard to copy its API key and signing secret. Secrets are shown once, so never log or commit them.1. Install Corsair and a plugin
@corsair-dev/github is an example. Swap it for the integration your app needs. Browse the integrations catalog for plugin ids: each page’s slug is the id.
2. Create corsair.ts and link your database
corsair.ts
database. Corsair persists connections and synced data there. Hub keeps no copy of your users’ tokens; it holds only the OAuth client id and secret (see Where your credentials live).
3. Add the /api/corsair route
The handler serves Hub delivery, meaning OAuth callbacks, connect pages, and self-registration, plus the management API, at its base path. Mount the adapter for your server:
- Next.js
- Express
- Hono
- Web-standard
app/api/corsair/[[...path]]/route.ts
Pages Router? Export a catch-all API route at
pages/api/corsair/[...path].ts and forward req/res through the same toNextJsHandler. The App Router is the supported default.hub config; it is resolved per environment (see Delivery URLs).
4. Add your keys to .env
Copy the values from your project’s Keys tab. Never commit them.
.env
CORSAIR_API_KEY and CORSAIR_SIGNING_SECRET for both environments — the key value itself (ck_dev_… / ck_prod_…) tells the SDK which one you’re in. Match whatever you reference in corsair.ts.
5. Start your app
/api/corsair registers this app’s delivery URL with Hub automatically. The App sync indicator in the dashboard header turns green once you are connected.
Only development keys self-register. When your local app opens a Corsair tunnel, Hub delivers over it; otherwise it derives a local delivery target (overridable with
CORSAIR_DELIVERY_URL) and falls back to a browser redirect. See Delivery URLs for details and production setup.What’s next
Delivery URLs
How development and production delivery differ.
Environments
Development vs production keys.
Connect / OAuth
Mint a connect link so users can sign in.
Dashboard
Manage keys, connections, and delivery URLs.