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

@nolag/signal

v0.1.0

Published

WebRTC signaling SDK for NoLag — peer discovery, offer/answer/ICE exchange

Readme

@nolag/signal

WebRTC signaling SDK for NoLag — peer discovery, offer/answer exchange, and ICE candidate relay.

How It Works with NoLag

NoLag is a real-time messaging platform that handles WebSocket connections, message routing, persistence, and scaling. This SDK wraps the low-level @nolag/js-sdk and gives you a purpose-built signaling API for WebRTC — peer discovery, SDP exchange, and ICE candidate relay — without managing topics or subscriptions yourself.

Note: This SDK handles signaling only (the coordination layer). The actual media streams (audio/video) are peer-to-peer via WebRTC. NoLag acts as the signaling server that helps peers find each other and negotiate connections.

Getting Your Token

  1. Sign up at nolag.app
  2. Create a new project in the portal
  3. Choose the Signal blueprint when creating an app — this pre-configures the signaling topic your WebRTC app needs
  4. Go to the app's Tokens page and generate an actor token
  5. Use that token when connecting with this SDK

Each token identifies a unique peer in NoLag. The blueprint handles all the infrastructure setup — you just build your video/audio UI.

Install

npm install @nolag/js-sdk @nolag/signal

Quick Start

import { NoLagSignal } from "@nolag/signal";

const signal = new NoLagSignal("YOUR_ACTOR_TOKEN");

await signal.connect();

const room = signal.joinRoom("call-room");

// When a new peer joins, start a WebRTC connection
room.on("peerJoined", async (peer) => {
  const pc = new RTCPeerConnection();

  // Send your offer
  const offer = await pc.createOffer();
  await pc.setLocalDescription(offer);
  room.sendOffer(peer.peerId, offer);

  // Send ICE candidates as they're discovered
  pc.onicecandidate = (e) => {
    if (e.candidate) {
      room.sendIceCandidate(peer.peerId, e.candidate);
    }
  };
});

// Handle incoming signals
room.on("signal", async (msg) => {
  switch (msg.type) {
    case "offer":
      // Set remote description, create answer, send it back
      break;
    case "answer":
      // Set remote description
      break;
    case "ice-candidate":
      // Add ICE candidate
      break;
    case "bye":
      // Peer hung up
      break;
  }
});

API Reference

NoLagSignal

Constructor

const signal = new NoLagSignal(token: string, options?: NoLagSignalOptions);

Options:

| Option | Type | Default | Description | |--------|------|---------|-------------| | metadata | Record<string, unknown> | — | Custom peer metadata | | debug | boolean | false | Enable debug logging | | reconnect | boolean | true | Auto-reconnect on disconnect |

Methods

| Method | Returns | Description | |--------|---------|-------------| | connect() | Promise<void> | Connect to NoLag | | disconnect() | void | Disconnect | | joinRoom(name) | SignalRoom | Join a signaling room | | leaveRoom(name) | void | Leave a room | | getRooms() | SignalRoom[] | Get all joined rooms | | getOnlinePeers() | Peer[] | Get all online peers |

Events

| Event | Payload | Description | |-------|---------|-------------| | connected | — | Connected to NoLag | | disconnected | — | Disconnected | | reconnected | — | Reconnected after disconnect | | error | Error | Connection or protocol error | | peerOnline | Peer | A peer came online | | peerOffline | Peer | A peer went offline |

SignalRoom

Methods

| Method | Returns | Description | |--------|---------|-------------| | sendOffer(toPeerId, offer) | void | Send an SDP offer | | sendAnswer(toPeerId, answer) | void | Send an SDP answer | | sendIceCandidate(toPeerId, candidate) | void | Send an ICE candidate | | sendBye(toPeerId) | void | Signal call end | | signal(toPeerId, type, payload) | void | Send a raw signal message | | getPeers() | Peer[] | Get peers in this room | | getPeer(peerId) | Peer \| undefined | Get a specific peer |

Events

| Event | Payload | Description | |-------|---------|-------------| | signal | SignalMessage | Incoming signal (offer/answer/ICE/bye) | | peerJoined | Peer | Peer joined the room | | peerLeft | Peer | Peer left the room |

Types

interface Peer {
  peerId: string;
  actorTokenId: string;
  connectionState: string;
  metadata?: Record<string, unknown>;
  joinedAt: number;
  isLocal: boolean;
}

interface SignalMessage {
  id: string;
  type: SignalType;
  fromPeerId: string;
  toPeerId: string;
  payload: unknown;
  timestamp: number;
}

type SignalType = "offer" | "answer" | "ice-candidate" | "renegotiate" | "bye";

License

MIT