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

@wireblob/wire

v1.0.4

Published

Wireblob's JavaScript SDK for browsers, React Native, Node.js and web workers

Readme

Wireblobs JavaScript SDK (Wire JS)

A lightweight realtime SDK for connecting to the Wireblob realtime network using a Pusher-compatible protocol.

Wire is built as a wrapper around pusher-js, providing:

  • simpler configuration
  • Wireblob-first defaults
  • browser support
  • Node.js support
  • React Native compatibility
  • Web Worker compatibility
  • future extensibility without breaking API compatibility

Installation

NPM

npm install @wireblob/wire

Yarn

yarn add @wireblob/wire

PNPM

pnpm add @wireblob/wire

Quick Start

ESM

import Wire from '@wireblob/wire';

const wire = new Wire('YOUR_APP_KEY', {
  host: 'eu-central-1.wireblob.com',
  secure: true
});

const channel = wire.subscribe('chat');

channel.bind('message', (data) => {
  console.log(data);
});

CommonJS

const WireModule = require('@wireblob/wire');
const Wire = WireModule.default || WireModule;

const wire = new Wire('YOUR_APP_KEY', {
  host: 'eu-central-1.wireblob.com',
  secure: true
});

const channel = wire.subscribe('chat');

channel.bind('message', (data) => {
  console.log(data);
});

CDN Usage

The CDN file is a self-contained browser bundle.

<script src="https://cdn.jsdelivr.net/npm/@wireblob/wire/lib/umd/wire.min.js"></script>

<script>
  const wire = new Wire('YOUR_APP_KEY', {
    host: 'eu-central-1.wireblob.com',
    secure: true
  });

  const channel = wire.subscribe('chat');

  channel.bind('message', (data) => {
    console.log(data);
  });
</script>

Constructor

new Wire(appKey, options)

Parameters

| Parameter | Type | Required | Description | | ----------- | ---------- | -------- | ---------------------- | | appKey | string | Yes | Application public key | | options | object | No | Connection options |

Configuration Options

| Option | Type | Default | Description | | --------------------- | ----------- | ----------------------------- | ------------------------------- | | host | string | eu-central-1.wireblob.com | Wireblob server hostname | | secure | boolean | true | Use secure websocket connection | | wsPort | number | 80 | WebSocket port | | wssPort | number | 443 | Secure WebSocket port | | enabledTransports | array | ['ws', 'wss'] | Allowed transports | | authEndpoint | string | null | Private/presence auth endpoint | | auth | object | {} | Additional auth configuration |

Subscribing to Channels

const channel = wire.subscribe('chat-room');

Listening for Events

channel.bind('message', (data) => {
  console.log(data);
});

Triggering Events

Client-side trigger

Sends a real-time event over the existing WebSocket connection. Requires a private- or presence- channel and the event name must start with client-.

const channel = wire.subscribe('private-chat');

channel.trigger('client-message', { text: 'Hello world' });

Server-side trigger (Node.js)

Sends an event via the Wireblob HTTP REST API. Requires appId, key, and secret. Never expose your secret in browser code.


import Wire from '@wireblob/wire';

// use this instead of import if using with commonJs
// const WireModule = require('@wireblob/wire');
// const Wire = WireModule.default || WireModule;

const wire = new Wire({
  appId:  'YOUR_APP_ID',
  key:    'YOUR_APP_KEY',
  secret: 'YOUR_APP_SECRET',
  host:   'eu-central-1.wireblob.com',
  secure: true
});

// Single channel
await wire.trigger('chat', 'message', { text: 'Hello from server' });

// Multiple channels
await wire.trigger(['chat', 'notifications'], 'message', { text: 'Broadcast' });

Unsubscribing

wire.unsubscribe('chat-room');

Connection Events

Connected

wire.connection.bind('connected', () => {
  console.log('Connected');
});

Error

wire.connection.bind('error', (error) => {
  console.error(error);
});

Disconnected

wire.connection.bind('disconnected', () => {
  console.log('Disconnected');
});

Manual Connect / Disconnect

wire.connect();
wire.disconnect();

Private Channels

const channel = wire.subscribe('private-chat');

Presence Channels

const channel = wire.subscribe('presence-room');

channel.bind('pusher:subscription_succeeded', (members) => {
  console.log(members);
});

Advanced Configuration

const wire = new Wire('YOUR_APP_KEY', {
  host: 'eu-central-1.wireblob.com',
  secure: true,
  wsPort: 80,
  wssPort: 443,
  enabledTransports: ['ws', 'wss'],
  authEndpoint: '/broadcasting/auth',
  auth: {
    headers: {
      Authorization: 'Bearer TOKEN'
    }
  }
});

Debugging

Enable internal Pusher logging:

Wire.logToConsole = true;

Architecture

Wire is:

  • protocol-compatible with Pusher Channels
  • transport-compatible with standard WebSocket infrastructure
  • designed for Wireblob-native extensions

Current implementation:

  • wraps pusher-js
  • applies Wireblob defaults
  • exposes a stable SDK surface

Future versions may introduce:

  • native Wire transport
  • SSE support
  • QUIC/WebTransport
  • MQTT adapters
  • custom protocol optimizations

Compatibility

| Platform | Supported | | ------------ | --------- | | Browser | Yes | | Node.js | Yes | | React Native | Yes | | Web Workers | Yes |

Credits

  • Pusher - Protocol and transport compatibility