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

@99xio/xians-sdk-typescript

v3.12.0

Published

A lightweight, framework-agnostic SDK for Agent WebSocket/SignalR communication

Downloads

673

Readme

XiansAi TypeScript/JavaScript SDK

A comprehensive TypeScript SDK for real-time and synchronous communication with XiansAi Server, enabling AI-powered workflows and conversations in your applications.

Features

  • 🔄 Real-time Communication: WebSocket-based chat with automatic reconnection
  • 🌐 HTTP REST API: Synchronous messaging and conversation management
  • 📡 Server-Sent Events: Live notifications and status updates
  • 🔐 Multiple Authentication: API Key, JWT Token, or JWT Callback support
  • 📝 TypeScript Support: Full type definitions and IntelliSense
  • 🛡️ Error Handling: Comprehensive error handling and logging
  • Async/Await: Modern promise-based API

Quick Start

Installation

npm install @99xio/xians-sdk-typescript
# or
yarn add @99xio/xians-sdk-typescript

Basic Usage

import { SocketSDK, RestSDK, MessageType } from '@99xio/xians-sdk-typescript';

// Real-time chat with WebSocket
const socketSDK = new SocketSDK({
  tenantId: 'your-tenant-id',
  apiKey: 'your-api-key',
  serverUrl: 'https://your-server.com',
  eventHandlers: {
    onReceiveChat: (message) => console.log('Received:', message.text)
  }
});

await socketSDK.connect();
await socketSDK.subscribeToAgent('workflow-id', 'user-123');
await socketSDK.sendInboundMessage({
  participantId: 'user-123',
  workflowType: 'customer-support',
  text: 'Hello!'
}, MessageType.Chat);

// Synchronous conversation with REST
const restSDK = new RestSDK({
  tenantId: 'your-tenant-id',
  apiKey: 'your-api-key',
  serverUrl: 'https://your-server.com'
});

const result = await restSDK.converse({
  participantId: 'user-123',
  workflow: 'customer-support',
  type: 'Chat',
  text: 'What is my order status?',
  timeoutSeconds: 30
});

Documentation Index

📚 Getting Started (Read in Order)

| Document | Description | When to Read | |----------|-------------|--------------| | Overview | Architecture, concepts, and SDK comparison | Start here to understand the system | | Authentication | API keys vs JWT tokens, security setup | Before implementing auth | | Quick Start Examples | Practical examples for each SDK | When ready to code |

🔧 SDK Documentation

| SDK | Description | Best For | |-----|-------------|----------| | REST SDK | HTTP-based synchronous communication | Request/response, server-to-server | | Socket SDK | Real-time bidirectional WebSocket | Interactive chat, live collaboration | | SSE SDK | Server-sent events for live updates | Notifications, status monitoring |

📖 Reference Documentation

| Document | Content | |----------|---------| | Types Reference | Complete TypeScript types and interfaces | | Message Types | Chat, Data, and Handoff message structures | | Authentication Examples | Detailed auth implementation patterns | | Advanced Examples | Complex scenarios and best practices |

🛠️ Development & Contributing

| Document | Purpose | |----------|---------| | Contributing Guide | Development workflow, testing, and publishing instructions |

Choosing the Right SDK

| Need | REST SDK | Socket SDK | SSE SDK | |------|----------|------------|---------| | Fire-and-forget messages | ✅ Best | ✅ Good | ❌ No | | Synchronous conversations | ✅ Best | ✅ Good | ❌ No | | Real-time notifications | ❌ No | ✅ Best | ✅ Best | | Bidirectional communication | ❌ No | ✅ Best | ❌ No | | Live dashboards | ❌ No | ✅ Good | ✅ Best | | Server-to-server | ✅ Best | ✅ Good | ✅ Good | | Web applications | ✅ Good | ✅ Best | ✅ Good |

👉 Not sure? Start with the Overview to understand which SDK fits your use case.

Learning Path

For Beginners

  1. Read Overview to understand the architecture
  2. Set up Authentication
  3. Try Quick Start Examples
  4. Explore individual SDK documentation as needed

For Experienced Developers

  1. Review Overview for architecture understanding
  2. Jump to relevant SDK documentation (REST, Socket, SSE)
  3. Check Advanced Examples for complex patterns

For Integration Teams

  1. Review Authentication for security considerations
  2. Study Message Types for data structures
  3. Implement using Authentication Examples

Support

  • 📖 Documentation: Complete guides in the docs folder
  • 🐛 Issues: Report bugs and request features in our repository
  • 💬 Community: Join our developer community for questions and discussion

License

This SDK is licensed under the MIT License. See the LICENSE file for details.