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 — 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.
2. Create corsair.ts and link your database
corsair.ts
database. Corsair persists connections and synced data there — Hub stores none of it (see Hub overview).
3. Add the /api/corsair route
The handler serves Hub delivery — OAuth callbacks, connect pages, and self-registration — at its base path. Mount the adapter for your server:
- Next.js
- Express
- Hono
- Other
app/api/corsair/[[...path]]/route.ts
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_DEV_* for development and CORSAIR_PROD_* for production so both can coexist. 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 — you are connected.
The delivery URL is derived from your app’s own config (
CORSAIR_DELIVERY_URL → PORT), never from an inbound request, and only development keys self-register. See Delivery URLs for detection order 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.