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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@airelogic/docs-chatbot

v1.1.0

Published

Chatbot for AireSuite Products

Downloads

1,145

Readme

@airelogic/docs-chatbot

A chatbot for the Airelogic documentation to be used in the Airesuite products.

Installation

npm install @airelogic/docs-chatbot

Usage

Basic Usage (Auto-mounting)

import React, { useRef } from "react";
import {
  useDocsBotChat,
  DocsBotChatRef,
  DocsBotOptions,
} from "@airelogic/docs-chatbot";

const widgetOptions: DocsBotOptions = {
  botName: "AireGlu Docs",
  description: "Ask me anything about AireGlu!",
  color: "#291b3e",
  alignment: "left",
  labels: {
    firstMessage:
      "Hi! I can help you with our documentation. What would you like to know?",
    floatingButton: "Help",
    inputPlaceholder: "Ask about our docs...",
    poweredBy: "Aireinnovate",
  },
  questions: [
    "How do I get started with AireGlu endpoints?",
    "What are the main features of AireGlu?",
    "How do I send an email from an AireGlu enpoint?",
  ],
  verticalMargin: 10, // use 70 if there is a footer
  horizontalMargin: 10,
  customCSS: `
    .docsbot-wrapper {
      height: calc(100% - 230px);
    }
    `, // Adjust height to fit the page when there is a footer
};

{
  /* Refer to AireGlu (magicman) on how the Bot Id is housed in an environment variable */
}
useDocsBotChat({
  botId: "a1QS54aX5vqaWUgXH9c1/QYNQLIJlzqpRsJX90lLE",
  options: widgetOptions,
});

// include component, the bot Id is unique for Airelogic
return (
  <div>
    <h1>Welcome to the Docs Chatbot Playground</h1>
  </div>
);

Manual Control

For more control over when the chatbot loads and mounts, you can disable automatic injection:

import React, { useRef, useState } from "react";
import {
  DocsBotChat,
  DocsBotChatRef,
  DocsBotOptions,
} from "@airelogic/docs-chatbot";

const { mount, unmount, toggle } = useDocsBotChat({
  botId: "your-bot-id",
  options: widgetOptions,
  inject: false,
});
const [isMounted, setIsMounted] = useState(false);

const handleMount = async () => {
  const success = await mount();
  setIsMounted(success || false);
};

const handleUnmount = async () => {
  const success = await unmount();
  setIsMounted(!success);
};

const handleToggle = () => {
  toggle();
};

return (
  <div>
    <div>
      <button onClick={handleMount} disabled={isMounted}>
        Mount Chatbot
      </button>
      <button onClick={handleUnmount} disabled={!isMounted}>
        Unmount Chatbot
      </button>
      <button onClick={handleToggle} disabled={!isMounted}>
        Toggle Chatbot
      </button>
    </div>
  </div>
);

Important: When using manual control, ensure you have added a reference to the docsbot script in your HTML.

<script src="https://widget.docsbot.ai/chat.js" async></script>

Props

| Prop | Type | Default | Description | | ------------------------ | -------------------- | ----------- | ----------------------------------------- | | botId | string | Required | The unique bot identifier | | options | DocsBotOptions | {} | Widget configuration options | | identify | DocsBotIdentify | undefined | User identification data | | signature | string | undefined | Authentication signature | | supportCallback | SupportCallback | undefined | Support ticket callback | | keyboardShortcuts | KeyboardShortcut[] | [] | Custom keyboard shortcuts | | enableDefaultShortcuts | boolean | true | Enable Ctrl+Q (toggle) and Escape (close) | | inject | boolean | true | Control automatic script injection |

Methods

The hook (or the component ref) provides several methods to control the chatbot widget:

  • mount() - Manually mount the chatbot widget
  • unmount() - Unmount and clean up the chatbot widget
  • open() - Open the chatbot interface
  • close() - Close the chatbot interface
  • toggle() - Toggle the chatbot interface open/closed
  • addUserMessage(message, send?) - Add a user message to the chat
  • addBotMessage(message) - Add a bot message to the chat
  • clearChatHistory() - Clear the chat history