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

signalwire

v1.0.5

Published

Client library for connecting to SignalWire.

Readme

SignalWire NodeJs


This package has been split in multiple packages!

If you are looking for the latest version of SignalWire for Node.js, please visit the package @signalwire/node.


This library provides a client for the Signalwire LaML and REST services.

It allows you to create calls, send messages, and generate LAML responses.

Installation

Install the package using NPM:

npm install signalwire

Usage

In order to use the client you must set the environment variable SIGNALWIRE_API_HOSTNAME!

Puts in your .env file your SignalWire host, project and token:

SIGNALWIRE_API_HOSTNAME=changeme.signalwire.com
SIGNALWIRE_API_PROJECT=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
SIGNALWIRE_API_TOKEN=PTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Setup Client

// Here we are using Project and Token from ENV
const RestClient = require('signalwire').RestClient
const client = new RestClient(process.env.SIGNALWIRE_API_PROJECT, process.env.SIGNALWIRE_API_TOKEN)

Make Call

client.calls.create({
  to: '+19999999999', // Call this number
  from: '+18888888888', // From a valid SignalWire number
  url: 'https://example.com/laml/voice.xml' // Valid LaML
}).then(call => {
  process.stdout.write('Call ID: ' + call.sid)
}).catch(error => {
  // Inspecting error...
})

Send Message

client.messages.create({
  body: 'Welcome to SignalWire!',
  to: '+19999999999', // Text this number
  from: '+18888888888' // From a valid SignalWire number
}).then(message => {
  process.stdout.write('Message ID: ' + message.sid)
}).catch(error => {
  // Inspecting error...
})

Generating LaML

const RestClient = require('signalwire').RestClient
const response = new RestClient.LaML.VoiceResponse()
response.dial({ callerId: '+18888888888' }, '+19999999999')
response.say("Welcome to SignalWire!")
process.stdout.write(response.toString())

LaML output:

<?xml version="1.0" encoding="UTF-8"?>
<Response>
  <Dial callerId="+18888888888">+19999999999</Dial>
  <Say>Welcome to SignalWire!</Say>
</Response>

Migration

Do you want to start using SignalWire in your current application? You can easily migrate the code with minimal changes!

Make sure you've set the env variable SIGNALWIRE_API_HOSTNAME as described in Usage and then:

To use the Rest client:

// Replace these lines:
const twilio = require('twilio')
const client = new twilio(sid, token)

// With ...
const signalwire = require('signalwire')
const client = new signalwire.RestClient(project, token)

// Now use client variable like you did before!

For calls and messages you should also change the from numbers with a valid SignalWire number!

To generate LaML:

// Replace these lines..
const twilio = require('twilio')
const response = new twilio.twiml.VoiceResponse()

// With ..
const signalwire = require('signalwire')
const response = new signalwire.RestClient.LaML.VoiceResponse()

// Now use response like you did before!
response.say('Hey, Welcome at SignalWire!')

Running tests in Docker

A Dockerfile is provided for testing purposes. Run docker run -it $(docker build -q .) to execute the test suite.

Copyright

Copyright (c) 2018 SignalWire Inc. See LICENSE for further details.