Skip to content

Client SDK

Cognipeer Client SDK

The official JavaScript/TypeScript SDK for building conversational AI applications, with client-side tool execution — your functions run in your environment, and the results flow straight back into the conversation.

  • Package @cognipeer/sdk
  • Runtime Node.js · browsers · edge, ESM & CommonJS
  • Tool calling OpenAI-compatible function format

Unlike SDKs that only support server-side tools, the Client SDK lets your JavaScript functions be called automatically by the AI, with full type safety and configurable retry logic — so sensitive operations stay on your own infrastructure instead of round-tripping through someone else's server.

bash
npm install @cognipeer/sdk
bash
yarn add @cognipeer/sdk
bash
pnpm add @cognipeer/sdk
typescript
import { CognipeerClient } from '@cognipeer/sdk';

const client = new CognipeerClient({
  token: 'pat_your-personal-access-token',
  hookId: 'your-channel-hook-id'
});

const response = await client.conversations.create({
  messages: [{ role: 'user', content: 'Hello! How can you help me?' }]
});

console.log(response.content);

Why the Client SDK

Automatic tool execution

No need to manually handle tool calls — the SDK detects them, runs your function, and feeds the result back into the conversation for you.

Client-side security

Sensitive operations run in your own environment. Nothing needs to be proxied through a server just to call a function.

OpenAI-compatible tool format

Tool definitions use the same function-calling shape as OpenAI, so existing schemas and mental models carry over directly.

Universal runtime support

Works in Node.js, browsers, and edge runtimes, shipped as both ESM and CommonJS with full TypeScript types.

Where to go next

Studio · Pulse · Console · Agent SDK and more — the Cognipeer documentation hub