/ developers · sdk
A typed client for every endpoint.
@inferrex/sdk is generated from the same route definitions the API runs on, so it never drifts from the server. One client, twenty resource groups, full autocomplete.
Install & instantiate
The package publishes to npm at launch. Until then, the REST API and your in-app API keys are live — this is the client you'll reach for.
npm install @inferrex/sdk
import { InferrexClient } from '@inferrex/sdk';
const client = new InferrexClient({
apiKey: process.env.INFERREX_API_KEY!,
baseUrl: 'https://api.inferrex.com', // optional; override for Enterprise/Sovereign
timeoutMs: 30_000, // optional; default 30s
});Resource groups
The client mirrors the API one-to-one. The groups you'll reach for most:
| Group | What it does | Example call |
|---|---|---|
| `connections` | Infer a provider's schema, check status, approve fields | `client.connections.inferConnection({ url, authType, priority })` |
| `credentials` | Store, list, rotate, revoke a connection's secrets | `client.credentials.storeCredentials(id, { authType, credentials })` |
| `pipelines` | Create, activate, sync; accept self-healing suggestions | `client.pipelines.triggerSync(id, { syncType })` |
| `library` | Search the connector corpus | `client.library.searchConnectors({ q: 'stripe' })` |
| `intelligence` | Usage meters, entity profiles, partner opportunities | `client.intelligence.getUsageMeters()` |
| `archival` | Activate retention, restore records, deletion certificates | `client.archival.getArchivalDashboard()` |
| `settings` | Mint and revoke API keys | `client.settings.createApiKey({ displayName })` |
The full set — connections, credentials, pipelines, intelligence, archival, library, settings, notifications, onboarding, billing, monitoring, workflows, golden_record, workspace and more — is enumerated, with every method, on the API reference.
Errors & timeouts
Calls reject with a typed error you can branch on:
import { InferrexClient, InferrexHttpError, InferrexTimeoutError } from '@inferrex/sdk';
try {
await client.pipelines.triggerSync(pipelineId, { syncType: 'incremental' });
} catch (err) {
if (err instanceof InferrexHttpError) {
console.error(err.status, err.body); // e.g. 402 — quota exceeded
} else if (err instanceof InferrexTimeoutError) {
// retry, or raise the timeoutMs on the client
}
}Notes
- Generated, not hand-written. The SDK is emitted from
services/api/route-definitions.ts— when the API gains an endpoint, the SDK gains a method on the next release. - Bring your own
fetch. Passfetchin the config to use a polyfill or instrument requests. - Workspace-scoped. Every call is scoped to the workspace that owns the API key — no tenant id to pass.

