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

@bookipi/ai-chat-pubsub

v0.0.9-20260701081231

Published

AI Chat frontend client communication

Readme

@bookipi/ai-chat-pubsub

Overview

This package provides a publish-subscribe (PubSub) communication system that enables seamless communication between Bookipi AI Chat and other Bookipi products.

Installation

For latest release:

npm install @bookipi/ai-chat-pubsub

For alpha release:

npm install @bookipi/ai-chat-pubsub@alpha

Development

Testing locally

  1. Build the Pubsub package
pnpm build
  1. Update your app's package.json by re-pointing @bookipi/ai-chat-pubsub to the path of the Pubsub package
"@bookipi/ai-chat-pubsub": "file:../ai-chat/packages/pubsub",
  1. Install
npm install
  1. Start your app

Publishing

In order to publish a package, you just need to create a tag and push it to the repository. The tag number has no connection to the actual package version nor the version in the package.json. The Code Pipeline gets triggered when it detects a new tag. Just make sure that the tag number is 1 number higher than the previous tag.

For production release:

Pubsub changes need to be merged into the main branch first before we can publish a new production version. Once merged, switch to the main branch and run the following commands.

Make sure to update the actual package version.

git tag package-release-v0.0.1
git push origin package-release-v0.0.1

The tag number should be 1 number higher than the previous tag.

e.g., from package-release-v0.0.1 > package-release-v0.0.2

For alpha release:

Pubsub changes need to be merged into the staging branch first before we can publish a new alpha version. Once merged, switch to the staging branch (or the project branch, as long as the commit for the Pubsub changes is there) and run the following commands.

Make sure to update the actual alpha package version.

git tag package-alpha-release-v0.0.1-1
git push origin package-alpha-release-v0.0.1-1

The tag number should be 1 number higher than the previous tag.

e.g., from package-alpha-release-v0.0.1 > package-alpha-release-v0.0.2

How to use

Main page

You need to initialize the library on the main page with 2 steps

  1. Import the library
import { PubSub } from "@bookipi/ai-chat-pubsub";
  1. Start it
const pubsub = PubSub.getInstance();

Sub page (within iframe or component)

  1. Import the library
import { Client, IMessage } from "@bookipi/ai-chat-pubsub";
  1. Define your page/component id
const pageId = "page-id";
  1. Start a new Client instance and register your page Id with pubsub manager
const [client] = useState(() => new Client(pageId)); // Register the client
  1. Listen for messages
client.onMessage((message: IMessage) => {
  setMessages((prev) => [...prev, message]);
});
  1. Sending a message
client.sendMessage(targetPageId, event);

// Note: event can be a string or a JSON object