Reference
Node SDK

Node SDK

A realtime, streaming-first JavaScript/TypeScript SDK for messaging with ProteusAI. It focuses on the messaging surface — agents, chats, messages, and repositories — and keeps a live connection to the Messaging API so agent responses can be streamed back to your app.

Installation

npm install @proteus-ai/sdk

or

yarn add @proteus-ai/sdk

Importing the SDK

import ProteusAI from '@proteus-ai/sdk';

Initializing the SDK

Create an instance by providing your access token (from your ProteusAI account Setup page).

const proteus = new ProteusAI({
  apiKey: 'user-3a4d80a9c3cca7ffd1bc341f...', // your access token
  // baseUrl: 'http://localhost:3000',        // optional; defaults to the hosted service
  // authToken: '<proteus-auth-jwt>',         // optional; sent as x-proteus-auth-token
  // autoConnect: true,                       // connect the realtime socket on construction (default)
});

Resources

ResourceDescription
proteus.agentsCreate and manage agents (REST).
proteus.chatsCreate chats, read history, join realtime rooms.
proteus.messagesSend messages and receive streamed replies.
proteus.repositoriesManage repositories and files (REST).

Connecting to the Service

connect() establishes the realtime connection and resolves once authenticated:

await proteus.connect();

Or register a callback that fires once the connection is authenticated:

proteus.connected(() => {
  console.log('Connected to ProteusAI');
  // Safe to send messages here.
});

Checking Connection Status

if (proteus.isConnected) {
  console.log('ProteusAI is connected');
}
 
if (proteus.isConnecting) {
  console.log('ProteusAI is connecting');
}

Disconnecting from the Service

proteus.disconnect();
console.log('Disconnected from ProteusAI');

Quick start

import ProteusAI from '@proteus-ai/sdk';
 
const proteus = new ProteusAI({ apiKey: 'user-3a4d80a9c3cca7ffd1bc341f...' });
await proteus.connect();
 
const chat = await proteus.chats.create({
  participants: [{ id: '<agentId>', type: 'AGENT' }],
});
await proteus.chats.join(chat.id);
 
proteus.messages.onDelta(({ contentDelta }) => process.stdout.write(contentDelta ?? ''));
proteus.messages.onDone((message) => console.log('\n', message.content));
 
await proteus.chats.send(chat.id, 'In one sentence, what is the web?');

© 2026 ProteusAI. All rights reserved