Installation
Requirements​
- Node.js 18+
- Server or edge runtime (browser blocked by default)
Install​
npm install @mappa-ai/conduit
Environment​
.env
CONDUIT_API_KEY=your_api_key_here
CONDUIT_WEBHOOK_SECRET=your_webhook_secret_here
Create the client​
import { Conduit } from "@mappa-ai/conduit"
const conduit = new Conduit({
apiKey: process.env.CONDUIT_API_KEY!,
baseUrl: "https://api.mappa.ai",
timeoutMs: 30_000,
maxRetries: 2,
})
Options​
| Option | Type | Default |
|---|---|---|
apiKey | string | required |
baseUrl | string | https://api.mappa.ai |
timeoutMs | number | 30000 |
maxRetries | number | 2 |
defaultHeaders | Record<string, string> | undefined |
userAgent | string | SDK default |
fetch | typeof fetch | runtime fetch |
telemetry | Telemetry | undefined |
dangerouslyAllowBrowser | boolean | false |
Security note​
- Keep
CONDUIT_API_KEYserver-side. - Consume completion through webhooks, not long blocking requests.