npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@koreai/agentai-sdk

v1.0.0

Published

AgentAI SDK - Universal JavaScript SDK for Node.js and Browser

Downloads

95

Readme

@koreai/agentai-node-sdk

A Node.js SDK for AgentAI with event-based messaging and socket communication.

Installation

npm install @koreai/agentai-node-sdk

Quick Start

const { AgentAI } = require('@koreai/agentai-node-sdk');

const client = new AgentAI({
  connection: {
    domainURL: 'https://your-agentassist-server.com',
    botId: 'your-bot-id',
    conversationId: 'your-conversation-id',
    token: 'your-jwt-token',
    interactiveLanguage: 'en',
    customData: {},
    channel: 'voice', // or 'chat'
    sessionId: '', // session id from platform of self service
  }
});


// Wait for connection to be ready
client.on('agentai_ready', (event) => {
  console.log('AgentAI is ready!', event);
  //you can start interacting with SDK from now!
});

// Listen for acknowledgments
client.on('agent_message_ack', (event) => {
  console.log('Agent message sent:', event);
});

client.on('user_message_ack', (event) => {
  console.log('User message sent:', event);
});

Configuration

Required Connection Parameters

| Parameter | Type | Description | |-----------|------|-------------| | domainURL | string | AgentAssist server URL | | botId | string | Bot identifier | | conversationId | string | Conversation identifier | | token | string | JWT authentication token | | interactiveLanguage | string | Language code (e.g., 'en') | | customData | object | Custom data object | | channel | string | Channel type ('voice', 'web') | | sessionId | string | Session identifier (optional) |

API

Methods

sendAgentMessage(payload)

Send a message as an agent. Returns true if sent successfully, false otherwise.

const success = client.sendAgentMessage({
  message: 'Hello!',
});

sendUserMessage(payload)

Send a message as a user. Returns true if sent successfully, false otherwise.

const success = client.sendUserMessage({
  message: 'Hello!',
});

internalTransfer(payload)

Call this method when internal agent transfer happens. Returns true on success, false otherwise.

  const transferData = {
    "transfertype": "NA", //warm, //cold
    "transition": "entry", //exit
    "participant": {
      "identity": "a-123xxxxx",
      "name": "a-xxxxxx",
      "type": "agent"
    }
  };
  const success = client.internalTransfer(transferData);

disconnect()

Disconnect from the socket server.

client.disconnect();

isConnected()

Check if the client is currently connected.

if (client.isConnected()) {
  // Socket is connected
}

Events

| Event | Description | |-------|-------------| | agentai_ready | Emitted when the connection is ready to send/receive messages | | agent_message_ack | Acknowledgment when agent message is saved | | user_message_ack | Acknowledgment when user message is saved | | error | Emitted for all errors (validation, connection, etc.) | | connect | Socket connected | | disconnect | Socket disconnected | | connect_error | Connection error occurred | | reconnect | Successfully reconnected | | reconnect_attempt | Attempting to reconnect |

Error Handling

All errors are emitted as events instead of being thrown. Always listen to the 'error' event:

client.on('error', (event) => {
  console.error('Error:', event.payload.message);
});

License

MIT