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

@lavapi/ngsip.js

v0.7.0

Published

Next Generation SIP/WebRTC library with full NG911 compliance

Downloads

38

Readme

NGSIP.js

A lightweight SIP/WebRTC client library for browsers. Connects over WebSocket (RFC 7118), handles SIP registration and INVITE dialogs, and delegates media to the browser's native RTCPeerConnection.

Features

  • SIP REGISTER with digest authentication (RFC 2617)
  • Outbound and inbound audio calls via INVITE/ACK/BYE
  • WebSocket transport with keep-alive and auto-reconnect
  • Multi-server connection pool — redundancy (all active) or single (failover) modes
  • TypeScript-first, zero runtime dependencies

Quick Start

Install

npm install ngsip.js

Or load the UMD bundle directly:

<script src="dist/ngsip.umd.js"></script>

Connect and Register

import { UA } from 'ngsip.js';

const ua = new UA({
  uri: 'sip:[email protected]',
  password: 'secret',
  wsServers: [
    { uri: 'wss://sip.example.com:8443', priority: 1 },
    { uri: 'wss://sip-backup.example.com:8443', priority: 2 },
  ],
  connectionMode: 'redundancy',
});

ua.on('registered', server => console.log('Registered via', server.uri));
ua.on('primaryChanged', server => console.log('Primary is now', server?.uri));

ua.start();

Make a Call

const session = ua.call('sip:[email protected]');

session.on('confirmed', () => {
  // Attach remote audio
  const audio = document.createElement('audio');
  audio.autoplay = true;
  audio.srcObject = session.remoteAudioStream;
  document.body.appendChild(audio);
});

session.on('terminated', cause => console.log('Call ended:', cause));

Answer an Incoming Call

ua.on('newRTCSession', (session, request) => {
  console.log('Incoming call from', request.headers.from.uri.user);

  session.ring();   // sends 180 Ringing

  // Accept:
  session.answer();

  // Or reject:
  // session.terminate();
});

Hang Up

session.terminate();

Disconnect

ua.stop();

Configuration

See docs/api.md for full UAConfig reference.

Multi-Server / Redundancy

const ua = new UA({
  uri: 'sip:[email protected]',
  password: 'secret',
  wsServers: [
    { uri: 'wss://server1.example.com:8443', priority: 1 },
    { uri: 'wss://server2.example.com:8443', priority: 2 },
    { uri: 'wss://server3.example.com:8443', priority: 3 },
  ],
  connectionMode: 'redundancy', // all servers connected simultaneously
});

In redundancy mode all servers are connected and registered at the same time. The lowest-priority-number server with a live registration is used as the primary for outbound calls. If it drops, the next registered server takes over instantly.

In single mode only the highest-priority server is active. When it drops, a 5-second failover timer fires before the next server is activated.

RFC Coverage

See docs/rfc-compliance.md.

API Reference

See docs/api.md.