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

biz-agent-hub

v1.0.3

Published

The **Biz Agent Hub JavaScript SDK** provides a simple way to integrate Biz Agent Hub agents (such as Support Agent) into your Node.js or browser applications.

Readme

Biz Agent Hub – JavaScript SDK

The Biz Agent Hub JavaScript SDK provides a simple way to integrate Biz Agent Hub agents (such as Support Agent) into your Node.js or browser applications.

With this SDK, you can:

  • Initialize a BizAgentHub client with your credentials
  • Interact with Support Agent via a simple query() API
  • Send messages and optional files (for example, images) to the bot
  • Use the SDK from both TypeScript and JavaScript

Installation

npm install biz-agent-hub

or with Yarn:

yarn add biz-agent-hub

Quick Start

ES Modules / TypeScript

import { BizAgentHub } from 'biz-agent-hub';
const userId = '<your_user_id>'; 
const apiKey = '<your_api_key>';
const client = new BizAgentHub(userId, apiKey);

async function run() { 
  const response = await client.supportAgent.query({ 
    message: 'Hello Support Agent!', 
    file: undefined, // Optional: a File object (browser) or compatible type 
    sessionId: undefined // Optional: reuse a session ID for conversation continuity 
  });

  console.log('Support Agent response:', response); 
}

run().catch(console.error);

CommonJS / JavaScript

const { BizAgentHub } = require('biz-agent-hub');
const userId = '<your_user_id>';
const apiKey = '<your_api_key>';
const client = new BizAgentHub(userId, apiKey);

(async () => {
    const response = await client.supportAgent.query({
        message: 'Hello Support Agent!',
        file: undefined,
        sessionId: undefined
    });

    console.log('Support Agent response:', response);
})();

API Reference

BizAgentHub

new BizAgentHub(userId: string, apiKey: string)

Creates an instance of the Biz Agent Hub client.

  • userId – Your Biz Agent Hub user identifier.

  • apiKey – Your API key for authentication.

Properties

  • supportAgent: SupportAgent

    Interface for interacting with the Support agent.


SupportAgent

query(options: SupportAgentQuery): Promise<any>

Send a message (and optional file) to Support Agent.

interface SupportAgentQuery { 
  /** The user message or question for Support Agent. */ 
  message: string;

  /**
   * - Optional file to send to the bot.
   * - In the browser, this should be a `File` object.
   * - In Node.js, you can use a compatible form-data file type depending on your setup. 
   */ 
  file?: File;

  /**
   * - Optional session ID.
   * - Use this to maintain conversation context between multiple messages. 
   */ 
  sessionId?: string; 
}

Example:

const result = await client.supportAgent.query({ 
  message: 'What is the main color in this image?', 
  file: imageFile, // e.g. from an <input type="file"> or Node.js equivalent
  sessionId: 'my-session-id-123', // optional but recommended for multi-turn conversations 
});

console.log(result);

Error Handling

The query() method throws an error when the underlying HTTP request fails or the server responds with an error status.

try { 
  const response = await client.supportAgent.query({ 
    message: 'Help me with my issue.', 
    file: undefined, 
    sessionId: undefined, 
  });

  console.log('Response:', response); 
} catch (err) { 
  console.error('Support Agent query failed:', err); 
}

TypeScript Support

This SDK is written in TypeScript and ships with type declarations:

  • Strong typing for BizAgentHub, SupportAgent, and SupportAgentQuery

  • Works out of the box with TypeScript projects

No additional configuration is required; just import and use.


Building From Source

If you are working on the SDK locally:

# Install dependencies
npm install
# Build TypeScript -> dist/
npm run build

The compiled JavaScript and type declarations will be emitted into the dist directory.


Support

If you encounter problems or have questions:

  • Open an issue in the GitHub repository

  • Include:

    • Your Node.js version

    • The biz-agent-hub version

    • A minimal code sample that reproduces the issue

This helps us diagnose and resolve problems quickly.