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

@hieco/realtime

v1.0.0

Published

Real-time streaming client for Hedera Mirror Node via HIP-694 JSON-RPC Relay

Readme

@hieco/realtime

@hieco/realtime is the Hieco client for live Hedera relay streams over the realtime JSON-RPC layer.

Use it when your app needs to move from “what happened?” to “what is happening right now?”

Why This Package Exists

Mirror reads are great for current state, but some apps need to stay subscribed to new events as they arrive. This package gives you:

  • a realtime relay client
  • connection lifecycle management
  • subscription primitives for live chain updates
  • a reusable foundation for framework bindings

When To Use It

Choose @hieco/realtime when you are building:

  • live dashboards
  • transaction or block feeds
  • event-driven backend services
  • apps that need websocket-style subscriptions without React

If you want the React wrapper, use @hieco/realtime-react.

Installation

npm install @hieco/realtime
pnpm add @hieco/realtime
yarn add @hieco/realtime
bun add @hieco/realtime

Quick Start

import { RelayWebSocketClient } from "@hieco/realtime";

const client = new RelayWebSocketClient({
  network: "testnet",
  endpoint: "wss://testnet.mirrornode.hedera.com/relay/ws",
});

const connected = await client.connect();

if (!connected.success) {
  throw new Error(connected.error.message);
}

const subscription = await client.subscribe({ type: "newHeads" }, (message) => {
  console.log(message.result);
});

if (subscription.success) {
  await client.unsubscribe(subscription.data);
}

await client.disconnect();

The Realtime Model

The package is centered around connection and subscription primitives:

  • connect
  • subscribe
  • react to stream state
  • unsubscribe
  • disconnect cleanly

That keeps it useful in scripts, services, and custom UI integrations where you want low-level control.

Client Choices

Inside the package there are two main connection models:

  • RelayWebSocketClient for one connection
  • ConnectionPool for multiple coordinated connections

Start with RelayWebSocketClient. Reach for ConnectionPool only when the app genuinely needs pooled subscriptions or load distribution.

Packaging And Runtime Support

The package ships browser-friendly ESM output with conditional exports for browser, worker, workerd, node, and default.

That does not change the runtime model of the websocket client itself, but it does make the package easier to consume in modern browser, edge, and server toolchains.

Related Packages