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

@doxajs/realtime

v0.1.0-alpha.33

Published

Typed subscriber client for Doxa realtime broadcasts.

Downloads

1,168

Readme

@doxajs/realtime

Controlled-adoption prerelease: Publicly downloadable under Apache-2.0; Midtown Home Improvements is the sole supported consumer. External use is permitted without compatibility, support, warranty, roadmap, or production-readiness commitments.

Typed protocol v3 subscriptions and authenticated ephemeral commands for Doxa realtime.

import { Realtime } from '@doxajs/realtime'

const realtime = new Realtime({ url: 'ws://127.0.0.1:6001/app' })
realtime.onConnectionState((state) => console.log('connection', state))
realtime.onError((error) => console.error(error.code, error.message))

const orders = realtime.private<{ 'order.shipped': { orderId: string } }>('orders.42')
orders.onStateChange((state) => console.log('orders', state))
orders.onError((error) => console.error(error.code, error.message))
orders.listen('order.shipped', ({ orderId }) => console.log(orderId))

For a production Keryx listener on a separate hostname, point authorization at the generated Doxa route as seen through the application's existing same-origin HTTP proxy:

const realtime = new Realtime({
  url: 'wss://realtime.example.com/app',
  authorizationEndpoint: '/canopy/broadcasting/authorize',
})

Realtime requests a fresh short-lived ticket with same-origin credentials before every connection and reconnect, then presents it outside the URL in the WebSocket subprotocol offer. The endpoint path is an ordinary public application path, not the private worker publish backchannel.

A browser WebSocket open event means only that the transport opened. Realtime waits for Keryx's authenticated connected frame before sending subscriptions. Connection and subscription state, structured errors, acknowledgement timeouts, terminal authentication failures, reconnect, and resubscription are observable through the public API.

Active subscriptions reconnect with capped exponential backoff and jitter. Explicit realtime.disconnect() disables reconnect; subscription.leave() removes that channel.

After the authenticated connected boundary, send a registered command and inspect its bounded result:

const result = await realtime.command('direct-messages.typing', {
  conversationId: 'conversation-1',
})
if (!result.ok) console.warn(result.error.code)

Commands reject immediately while disconnected. They are never queued, replayed, or automatically retried, and a timeout or disconnect settles the pending result even if a late acknowledgement arrives. The default acknowledgement timeout is 15 seconds, deliberately longer than Doxa's maximum 10-second server command deadline; override it with commandTimeoutMilliseconds when needed.