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

piopiyjs

v0.15.0

Published

Official PIOPIY WebRTC SDK for high-quality voice communication and telephony integration in the browser.

Readme

PIOPIY Client JS SDK

The PIOPIY WebRTC SDK for Javascript enables high-quality voice communication directly within the browser. It supports making and receiving calls to PSTN (Public Switched Telephone Network), App-to-App, and Browser-to-Browser.

Key Features

  • Crystal Clear Audio: High-fidelity WebRTC-based voice.
  • Cross-Platform: Seamless communication between browsers and traditional phones.
  • Rich Call Control: Mute, Hold, Transfer, and DTMF support.
  • Metadata Support: Extract custom SIP headers and transfer information.

Installation

Installation via NPM

npm install piopiyjs

Installation via Yarn

yarn add piopiyjs

Quick Start

1. Initialization

Create a new PIOPIY instance with your configuration.

import PIOPIY from 'piopiyjs';

const piopiy = new PIOPIY({
    name: "Display Name",
    debug: false,
    autoplay: true,
    ringTime: 60,
});

Configuration Options

| Attribute | Description | Type | Default | | :--- | :--- | :--- | :--- | | name | Your display name shown to other parties | string | none | | debug | Enable detailed console logging for troubleshooting | boolean | false | | autoplay | Automatically handle and play remote audio streams | boolean | true | | ringTime | Maximum duration for an incoming call to ring (seconds) | number | 60 |

2. Authentication

Connect to the PIOPIY SBC using your account credentials.

piopiy.login("user_id", "password", "SBC_URI");

Regional SBC Endpoints

| Region | SBC URI | | :--- | :--- | | Asia | sbcsg.telecmi.com | | Europe | sbcuk.telecmi.com | | America | sbcus.telecmi.com | | India | sbcind.telecmi.com, sbcindncr.telecmi.com |


Methods

call(phone_number, options)

Initiates an outgoing call to a PSTN number or another extension.

  • phone_number: The target number in E.164 format (e.g., 13158050050).
  • options: (Optional) JSON object containing extra_param for webhook headers.

getCallId()

Returns the unique identifier for the current active call.

  • Returns: A string (UUID or SIP ID) or false if no active call exists.

[!TIP] Use this method to track calls or interact with the PIOPIY REST API.

answer()

Answers an incoming call.

reject()

Rejects/Disconnects an incoming call.

terminate()

Hangs up an ongoing call.

hold() / unHold()

Places the active call on hold or resumes it.

mute() / unMute()

Mutes or unmutes your local microphone.

sendDtmf(tone)

Sends a DTMF tone (0-9, *, #) to the remote party.

transfer(to)

Transfers the call to another agent or number.

teamTransfer(to)

Transfers the call to a specific team or group.

logout()

Disconnects from the SBC session.


Event Handlers

The SDK uses an event-driven architecture. Listen for events using .on(eventName, callback).

Authentication Events

  • login: Triggered upon successful authentication.
  • loginFailed: Triggered when authentication fails (e.g., code 401: Invalid credentials).
  • logout: Triggered when the user logs out successfully.

Call Lifecycle Events

  • inComingCall: Triggered when a new call arrives.
piopiy.on("inComingCall", (data) => {
    console.log("Caller:", data.from);
    if (data.team_name) console.log("Team:", data.team_name);
    if (data.call_id) console.log("Unique ID:", data.call_id);
});

| Payload Property | Description | | :--- | :--- | | from | Display name or number of the caller | | team_name | (Optional) Name of the assigned team/group | | to_number | (Optional) The target virtual number | | call_id | Unique identifier for this call session | | transfer_from | (Optional) Originating agent if this is a transfer | | transfer_to | (Optional) Target agent if this is a transfer |

  • trying: The outgoing call is being initiated.
  • ringing: The call is currently ringing.
  • answered: The call has been picked up.
  • ended: The call has concluded successfully.
  • hangup: The call was terminated or rejected.
  • error: A generic error occurred.

Media Events

  • callStream: Triggered when the remote media stream is established.
  • mediaFailed: Triggered if the SDK cannot access local audio devices.

Development & Security

The SDK includes built-in ESLint rules to ensure code quality.

# Run linter
npm run lint

# Auto-fix lint errors
npm run lint:fix

License

Apache-2.0 © TeleCMI