Skip to main content
Coding agents: follow Agent setup first (SDK provisioning; ask the user when instance, tenant, or plugins are unclear). This page is API reference for the SDK methods.
npm install @corsair-dev/app

Client

import { createClient } from "@corsair-dev/app";

const corsair = createClient({
  apiKey: process.env.CORSAIR_DEV_KEY!,
  // baseUrl: "http://localhost:3000",  // self-hosted
});

Minimal provisioning

const { id } = await corsair.instances.create({ name: "my-app" });
const inst = corsair.instance(id);

await inst.plugins.upsert("slack", { mode: "cautious" });

const tenant = await inst.tenants.create("user-abc");
const t = inst.tenant(tenant.id);

// Send the user a link to connect their accounts (OAuth + API keys)
const { url } = await t.connectLink.create();

// Or set credentials directly if you already have them:
// await t.plugins.credentials.set("slack", "api_key", "xoxb-...");

Next

For agents and UI actions, see Coding agents, Agent SDKs, and Direct execution.