Cognipeer Client SDK

Studio Integration SDK
Studio Integration

Official JavaScript and TypeScript SDK for Cognipeer Studio. Connect applications to Studio conversations, channels, peers, users, and client-side tool execution from the browser or server.

Product and application teams integrating Cognipeer Studio into web apps, backends, and custom conversational experiences.

Studio conversations
Client-side tool execution
Browser and Node integrations

Key Features

Studio Resource APIs

Work with Studio conversations, channels, peers, and users through a typed JavaScript and TypeScript client.

Client-Side Tool Execution

Define JavaScript functions in your app and let the AI call them directly with structured arguments and retry-aware execution.

Browser + Node Support

Run the same SDK in browser applications, Node.js services, and edge-compatible environments.

Hook and Token Auth

Authenticate with Studio-compatible credentials such as personal access tokens and hook-based integration flows.

Flow Support

Trigger structured workflows and automations with predictable request and response contracts.

Type-Safe Integration

Use full TypeScript types for requests, responses, pagination, and client tool contracts.

OpenAI-Style Tool Shape

Reuse familiar function-calling schemas while keeping tool execution on your own client or infrastructure.

Quick Start

Use the Client SDK when you are integrating Cognipeer Studio concepts into your own product and want browser-safe, type-safe access to conversations, channels, peers, and client-side tools.

Installation

npm install @cognipeer/sdk

Initialize The Client

import { CognipeerClient } from '@cognipeer/sdk';

const client = new CognipeerClient({
  token: process.env.COGNIPEER_PAT!,
  hookId: 'your-channel-hook-id',
});

Read Studio Context

const peer = await client.peers.get();
const user = await client.users.get();
const channel = await client.channels.get();

console.log(peer.name, user.email, channel.name);

Create A Conversation With Client Tools

const response = await client.conversations.create({
  messages: [
    { role: 'user', content: 'What is the weather in Berlin?' },
  ],
  clientTools: [
    {
      type: 'function',
      function: {
        name: 'getCurrentWeather',
        description: 'Get current weather for a location',
        parameters: {
          type: 'object',
          properties: {
            location: { type: 'string' },
          },
          required: ['location'],
        },
      },
      implementation: async ({ location }) => {
        return { location, forecast: 'Sunny', temperatureC: 22 };
      },
    },
  ],
});

console.log(response.content);

Cognipeer Client SDK vs Alternatives

ProductPrimary RoleStudio AuthClient ToolsBrowser ReadyTyped ResourcesConversation APIFlow SupportPaginationOpen Source

Cognipeer Client SDK

Studio Integration SDK

Direct REST Calls

Handwritten HTTP Client

OpenAI Node SDK

Model Provider SDK

Generic Fetch Wrapper

Custom API Helper