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

piopiy

v1.1.0

Published

The official Node.js SDK for PIOPIY - a complete Voice AI Agent and CPaaS Platform. Easily build intelligent Voice Agents, manage complex call flows (queues, human handoff), execute bulk voice campaigns, and send multi-channel notifications via WhatsApp a

Downloads

652

Readme

piopiy

The official Node.js SDK for PIOPIY - a complete Voice AI Agent and CPaaS Platform. Easily build intelligent Voice Agents, manage complex call flows (queues, human handoff), execute bulk voice campaigns, and send multi-channel notifications via WhatsApp and SMS.

Installation

npm install piopiy

Usage

Authentication

Initialize the client with your API Token.

const { Piopiy } = require('piopiy');
const client = new Piopiy("YOUR_API_TOKEN");

AI Voice Agent

Make an AI-powered voice call.

const options = {
    options: {
        max_duration_sec: 80, // Set max call duration
        record: true          // Enable recording
    },
    variables: {
        customer_id: "CUST_1001", // Custom variables for the AI Agent
        campaign: "summer_sale_2025",
        priority: 2
    }
};

client.ai.call("9198xxxxxx", "9198xxxxxx", "YOUR_AGENT_ID", options)
    .then(res => {
        console.log("Call Initiated:", res);
    })
    .catch(err => {
        console.error("Error:", err);
    });

Arguments

| Argument | Type | Description | | :--- | :--- | :--- | | to | String | Destination number (e.g., "9198xxxxxx"). Pattern: ^[1-9][0-9]{6,15}$ | | caller_id | String | Caller ID (e.g., "9198xxxxxx"). Pattern: ^[1-9][0-9]{6,15}$ | | agent_id | String | The UUID of the AI Agent to connect. | | options | Object | Optional settings and variables. |

Options Object

| Key | Type | Description | | :--- | :--- | :--- | | max_duration_sec | Number | Maximum call duration in seconds (30 - 7200). | | ring_timeout_sec | Number | Ring timeout in seconds (5 - 120). | | record | Boolean | Set true to record the call. |

Variables Object

Pass custom data to your AI Agent. Keys must match the pattern ^[A-Za-z_][A-Za-z0-9_]*$.

Hangup Call (AI)

Terminate an active AI call.

client.voice.hangup("call_uuid", "NO_BALANCE", "NORMAL_CLEARING")
    .then(res => {
        console.log(res);
    })
    .catch(err => {
        console.error(err);
    });

| Argument | Type | Description | | :--- | :--- | :--- | | call_id | String | The unique UUID of the call to hang up. | | reason | String | Custom reason for the hangup (e.g., "NO_BALANCE"). | | cause | String | SIP hangup cause (default: "NORMAL_CLEARING"). |

PCMO (Programmable Call Media Operations)

Create complex call flows using PiopiyAction.

const { PiopiyAction } = require('piopiy');
const action = new PiopiyAction();

// Example: Play a music file
action.playMusic("https://example.com/welcome.mp3");

// Example: Speak text
action.speak("Hello, welcome to Piopiy.");

// Generate PCMO array
console.log(action.PCMO());

Available Methods

playMusic(audioFileOrUrl) Play an audio file (.mp3 or .wav).

  • audioFileOrUrl: URL or filename of the audio.

speak(text) Convert text to speech.

  • text: The text to speak.

input(url, options) Collect DTMF input from the user.

  • url: The webhook URL to send the digits to.
  • options:
    • max_digit: Max digits to collect.
    • timeout: Timeout in seconds.

playGetInput(url, audioFileOrUrl, options) Play an audio file and then collect input.

  • url: Webhook URL for the input.
  • audioFileOrUrl: Audio to play.
  • options: max_digit, retry, timeout.

call(to, caller_id, options) Bridge the call to another number (PSTN).

  • to: Number or array of numbers to call.
  • caller_id: Caller ID.
  • options: duration, timeout, loop, ring_type ('group').

forward(to, caller_id, options) Connect the call to a SIP user.

  • to: SIP user or array of users.
  • caller_id: Caller ID.
  • options: duration, timeout, loop, record, ring_type.

stream(url, options) Stream call audio to a WebSocket URL.

  • url: WebSocket URL (ws:// or wss://).
  • options:
    • listen_mode: 'caller', 'callee', or 'both'.
    • stream_on_answer: Boolean.

record() Start recording the call.

hangup() Hangup the call.

setValue(text) Set a custom parameter/value for the flow.

clear() Clear the current action list.

For more comprehensive documentation, visit piopiy.com.