@connect-crm/sdk
v0.1.0
Published
Official Connect-CRM TypeScript SDK for the Connect-CRM API (api.connect-crm.com)
Readme
Connect-CRM TypeScript SDK
Official TypeScript SDK for the Connect-CRM API (api.connect-crm.com).
Generated from the public OpenAPI specification with @hey-api/openapi-ts, with full types for every operation — including the polymorphic attribute values on records.
Installation
npm install @connect-crm/sdk
# or
pnpm add @connect-crm/sdkRequires Node.js 22+.
Usage
Create an API key in Settings → API keys in your Connect-CRM workspace.
import { connectCrm, upsertRecord, listRecords } from '@connect-crm/sdk'
const client = connectCrm({ apiKey: process.env.CONNECT_CRM_API_KEY! })
// Create-or-update a record by a matching attribute (idempotent)
const record = await upsertRecord({
client,
path: { object: 'contacts' },
body: {
matching_attribute: 'email',
data: {
email: '[email protected]',
name: { first_name: 'Jane', last_name: 'Doe' },
},
},
})
// Query records
const contacts = await listRecords({
client,
path: { object: 'contacts' },
body: { limit: 100, offset: 0 },
})Every operation is a typed function taking { client, path?, query?, body? } and returning the typed response. See src/generated/sdk.gen.ts for the full surface.
API keys are server-side secrets
Connect-CRM API keys grant workspace-level access. Use this SDK from servers only — never ship an API key to a browser.
Versioning
The SDK is pre-1.0; minor releases may contain breaking changes. The generated code is regenerated automatically when the API's OpenAPI specification changes.
