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

itqbot

v0.4.1

Published

AI call bot

Downloads

29

Readme

npm version patch
npm run build   
npm publish --access public

ITQ Voice Bot (itqbot)

Голосовой виджет для сайта: исходящий SIP‑звонок (JsSIP) с авторизацией по email и OTP, темами и простым UI. Поставляется в двух формах — CDN/IIFE для быстрого подключения через <script> и как npm‑пакет с ESM ядром и React‑обёрткой.

Содержание

  • Быстрый старт (CDN)
  • Установка (npm)
  • Варианты интеграции: Core (ESM) и React
  • Конфигурация (LiveBotConfig)
  • Публичный API (BotAPI)
  • Темизация
  • Логи и отладка
  • Сборка/скрипты и экспорты

Быстрый старт (CDN)

JsSIP входит в бандл, поэтому достаточно подключить один файл скрипта. Виджет поднимется автоматически с базовой конфигурацией из сборки и положит API в window.LiveBot.

<!doctype html>
<meta charset="utf-8">
<body>
  <script src="https://cdn.jsdelivr.net/npm/itqbot@latest/dist/index.global.js"></script>
  <script>
    // Примеры вызовов:
    window.LiveBot?.open?.();
    // window.LiveBot?.startCall?.();
  </script>
  <!-- Для локальной песочницы см. index.html в репо -->
  </body>

Установка (npm)

npm i itqbot

Варианты интеграции

  1. Core (ESM, без сайд‑эффектов)
import createBot from 'itqbot/core'
import type { LiveBotConfig } from 'itqbot/core'

const bot = createBot({
  telephony: {
    WSS_URL: 'wss://<pbx>/asterisk/ws',
    SIP_USER: '<user>',
    SIP_PASS: '<pass>',
    SIP_DOMAIN: '<realm>',
    ICE_SERVERS: [],
  },
  callTarget: '1000',
  persistUA: true,
});

bot.init();
// bot.open(); bot.startCall(); ...
  1. React — компонент
import { LiveBot } from 'itqbot/react'

export default function Page() {
  return (
    <LiveBot
      telephony={{
        WSS_URL: 'wss://<pbx>/asterisk/ws',
        SIP_USER: '<user>',
        SIP_PASS: '<pass>',
        SIP_DOMAIN: '<realm>',
      }}
      callTarget="1000"
      persistUA
      onReady={(api) => {
        // api.open(); api.startCall(); ...
      }}
      style={{ position: 'fixed', inset: 0, pointerEvents: 'none' }}
    />
  );
}
  1. React — хук
import { useLiveBot } from 'itqbot/react'

export function Widget() {
  const { mountRef, api, ready } = useLiveBot({
    telephony: { WSS_URL: 'wss://<pbx>/asterisk/ws', SIP_USER: '<u>', SIP_PASS: '<p>', SIP_DOMAIN: '<realm>' },
    callTarget: '1000',
  });

  return (
    <div>
      <div ref={mountRef} />
      <button onClick={() => api?.open?.()} disabled={!ready}>Open</button>
    </div>
  );
}

Примечания

  • Core/React не создают глобалов и не трогают DOM при import.
  • В IIFE/ CDN режиме API доступен как window.LiveBot.

Конфигурация (LiveBotConfig)

  • telephony: настройки SIP/WS
    • WSS_URL: wss://host:port/asterisk/ws
    • SIP_USER, SIP_PASS, SIP_DOMAIN
    • ICE_SERVERS?: массив RTCIceServer
  • callTarget: строка или функция, вычисляющая целевой номер/URI
  • mount?: контейнер (HTMLElement или селектор). По умолчанию document.body
  • texts?: частичный словарь текстов интерфейса
  • theme?: CSS‑переменные для темы (см. Темизация)
  • otpProvider?: кастомный провайдер OTP (по умолчанию — встроенные HTTP эндпоинты)
  • persistUA? (bool): сохранять/не останавливать SIP UA при закрытии виджета (по умолчанию true)
  • autoOpen? (bool): открыть панель сразу после init
  • exposeGlobalAs?: имя для публикации API в window["..."] (обычно нужно только в IIFE)
  • onEvent?: хук событий для аналитики

Публичный API (BotAPI)

  • init() / destroy()
  • open() / close()
  • startCall() / endCall()
  • getState(): ViewState
  • getConfig?(): LiveBotConfig
  • setTheme?(vars) — применить CSS‑переменные темы
  • updateConfig(partial) — обновить конфиг на лету (перезапускает телефонию)

Темизация

  • Через конфиг: theme: { '--lb-accent': '#0ea5e9', ... }
  • Во время работы: api.setTheme({ '--lb-accent': '#ec4899' })
  • Предопределённые пресеты см. в src/utils/const.ts

Логи и отладка

  • В IIFE для быстрой проверки доступен window.SipMini с методами sipInit, sipCall, sipHangup, sipDispose, sipGetState.
  • Включение сайдбара логов (экспериментально): параметр ?logs=true добавит боковую панель и подключится к WS (wss[s]://<host>/ws или wss://api.ai-qubedev.ru/ws).

Сборка/скрипты и экспорты

Скрипты

npm run build     # сборка dist/
npm run dev       # watch
npm version patch # семвер
npm publish --access public

Экспорты пакета

  • itqbot → ESM + IIFE (CDN). Типы: dist/index.d.ts
  • itqbot/core → ESM ядро без сайд‑эффектов. Типы: dist/core.d.ts
  • itqbot/react → React компонент/хук (ESM). Типы: dist/react/index.d.ts

Требования

  • Браузерная среда (WebRTC/MediaDevices для звонка)
  • Для React: react, react-dom как peerDependencies