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

@saastemly/helpbot-sdk

v0.1.0

Published

Official Node.js SDK for the HelpBot API

Readme

@helpbot/sdk

Official Node.js/Bun SDK for the HelpBot API.

Zero dependencies. Requires Node.js 18+ (native fetch) or Bun.

Installation

npm install @helpbot/sdk
# or
bun add @helpbot/sdk

Quick Start

import { HelpBot } from '@helpbot/sdk'

const bot = new HelpBot({ apiKey: 'wk_live_abc123' })

const { answer, sources, conversationId } = await bot.chat('How do I reset my password?')
console.log(answer)

Constructor Options

const bot = new HelpBot({
  apiKey: 'wk_live_abc123',           // Required
  baseUrl: 'https://app.helpbot.com', // Optional (or set HELPBOT_BASE_URL env var)
  timeout: 30_000,                    // Optional, ms (default: 30s)
  fetch: customFetch,                 // Optional, custom fetch implementation
})

API Reference

Chat

// Ask a question
const { answer, sources, conversationId } = await bot.chat('How do I reset my password?', {
  sessionId: 'user-session-123', // optional
  language: 'en',                // optional
})

// Submit feedback
await bot.feedback(conversationId, 'yes') // 'yes' | 'no'

// Request human handoff
await bot.handoff(conversationId, { customerEmail: '[email protected]' })

Sources (Scale plan)

// List all FAQ sources
const { sources } = await bot.sources.list()

// Add a new source URL
const { source } = await bot.sources.add('https://docs.example.com/faq')

// Re-scrape an existing source
await bot.sources.rescrape(source.id)

// Delete a source
await bot.sources.remove(source.id)

Config

// Get widget configuration
const config = await bot.config.get()

// Update configuration
const { updated, config: newConfig } = await bot.config.update({
  primaryColor: '#4f46e5',
  botName: 'Support Bot',
  greeting: 'Hi! How can I help?',
})

Analytics (Growth+ plan)

// Overview stats
const overview = await bot.analytics.overview({ range: '30d' })
console.log(overview.totalQuestions, overview.satisfactionRate)

// Daily activity
const { activity } = await bot.analytics.activity({ range: '7d' })

// List conversations with filtering
const { conversations, totalDocs, totalPages } = await bot.analytics.conversations({
  filter: 'unanswered', // 'all' | 'unanswered' | 'helpful' | 'unhelpful' | 'handoff'
  page: 1,
  limit: 20,
  range: '30d',
  search: 'password',
  sort: '-createdAt',
})

Webhooks (Growth+ plan)

// Create a webhook
const { webhook } = await bot.webhooks.create({
  url: 'https://example.com/webhook',
  events: ['conversation.created', 'conversation.handoff'],
  description: 'Production webhook',
})
// Save webhook.secret — it's only shown once!

// List webhooks
const { webhooks } = await bot.webhooks.list()

// Delete a webhook
await bot.webhooks.delete(webhook.id)

Webhook Signature Verification

Verify incoming webhook payloads without instantiating the client:

import { verifyWebhook } from '@helpbot/sdk'

// In your webhook handler (e.g. Express, Hono, etc.)
app.post('/webhook', (req) => {
  const signature = req.headers['x-helpbot-signature']
  const isValid = verifyWebhook(req.rawBody, signature, process.env.WEBHOOK_SECRET)

  if (!isValid) {
    return new Response('Invalid signature', { status: 401 })
  }

  const event = JSON.parse(req.rawBody)
  console.log(event.event, event.data)
})

Error Handling

import { HelpBotAPIError, HelpBotTimeoutError, HelpBotNetworkError } from '@helpbot/sdk'

try {
  await bot.chat('test')
} catch (err) {
  if (err instanceof HelpBotAPIError) {
    console.log(err.status) // HTTP status code (401, 403, 429, etc.)
    console.log(err.body)   // Parsed JSON error body
  } else if (err instanceof HelpBotTimeoutError) {
    console.log('Request timed out')
  } else if (err instanceof HelpBotNetworkError) {
    console.log('Network error:', err.cause)
  }
}

Webhook Events

| Event | Description | |---|---| | conversation.created | A new conversation was created | | conversation.unanswered | The AI couldn't answer the question | | conversation.feedback | User submitted feedback | | conversation.handoff | User requested human support |

License

MIT