SDK Quick Start

The Curviate TypeScript SDK is the fastest way to drive LinkedIn from an agent. It ships its own types, handles pagination, and exposes every API operation as a typed method.

Prerequisites

  • Node.js 18 or newer, and a TypeScript project if you want the types.
  • A Curviate API key. Quickstart shows how to create one. Keys look like cvt_live_...; treat one like a password.
  • A connected LinkedIn account, for anything account-scoped. Listing accounts and managing webhooks work with just a key. Everything that touches LinkedIn itself (messages, profiles, search, posts) needs an account connected first; Quickstart covers that too.

Install

npm install @curviate/sdk

The SDK also works with pnpm, yarn, and bun (pnpm add / yarn add / bun add @curviate/sdk).

Import and initialize

import { Curviate } from "@curviate/sdk";
 
const curviate = new Curviate({ apiKey: "cvt_live_..." });

The client talks to https://api.curviate.com and authenticates with your API key.

Your first call

The simplest read is listing the LinkedIn accounts connected to your tenant:

import { Curviate } from "@curviate/sdk";
 
const curviate = new Curviate({ apiKey: "cvt_live_..." });
 
const page = await curviate.accounts.list();
for (const account of page.items ?? []) {
  console.log(account.account_id);
}
// `page.cursor` is the opaque cursor for the next page (null when exhausted).

Scoping calls to an account

Most read operations and every write require a LinkedIn account context. Bind one with curviate.account(id), then call any resource on the returned scope:

import { Curviate } from "@curviate/sdk";
 
const curviate = new Curviate({ apiKey: "cvt_live_..." });
 
const acct = curviate.account("acc_YOUR_ACCOUNT_ID");
const chats = await acct.messaging.listChats();
console.log(chats.items?.length);

Root-scoped operations need no account context. curviate.accounts.* (the accounts themselves) curviate.webhooks.* (tenant-wide webhooks) and curviate.drafts.* (stored posts you can schedule) are called directly on the client.

Pagination

Any method that returns a cursor can be iterated with curviate.paginate(), an async iterable that fetches each page on demand.

Pass the call wrapped in an arrow function, as below. paginate() invokes what you give it, so a bare method reference such as curviate.accounts.list arrives detached from its resource and throws a TypeError on the first page. The arrow function keeps the method attached; curviate.accounts.list.bind(curviate.accounts) works too.

import { Curviate } from "@curviate/sdk";
 
const curviate = new Curviate({ apiKey: "cvt_live_..." });
 
for await (const account of curviate.paginate((params) => curviate.accounts.list(params), {})) {
  console.log(account.account_id);
}

Type safety

The SDK ships its own TypeScript types, so no @types/ package is needed. Request bodies, query params, and response shapes are all fully typed, and CurviateError exposes a stable code you can branch on exhaustively.

Next steps

  • accounts.list is the first call that works with nothing but a key. An empty items array means the key is good and no LinkedIn account is connected yet.
  • Quickstart connects that first account.
  • messaging.listChats is the first account-scoped read worth making once you have one.
  • Error codes reference lists every CurviateError.code and what to do about each.