Skip to main content

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​

OptionTypeDefault
apiKeystringrequired
baseUrlstringhttps://api.mappa.ai
timeoutMsnumber30000
maxRetriesnumber2
defaultHeadersRecord<string, string>undefined
userAgentstringSDK default
fetchtypeof fetchruntime fetch
telemetryTelemetryundefined
dangerouslyAllowBrowserbooleanfalse

Security note​

  • Keep CONDUIT_API_KEY server-side.
  • Consume completion through webhooks, not long blocking requests.