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

@dataflows/sms

v0.1.0

Published

Official Node.js client for the DataFlows SMS API

Readme

DataFlows SMS for Node.js

The official Node.js client for the DataFlows SMS API. It has no dependencies and needs Node 18 or newer.

Install

npm install @dataflows/sms

Send your first SMS

Find your API token in your DataFlows account under Developers, and keep it in an environment variable:

export DATAFLOWS_API_TOKEN="your-token"
import { DataFlows } from '@dataflows/sms';

const client = new DataFlows();

const result = await client.sms.send({
  recipient: '61404235133',
  senderId: 'YOUR_SENDER_ID',
  message: 'Hello from DataFlows',
});

console.log(result.campaign_id);

This really sends a text and uses your credit, so change the number first. require works too:

const { DataFlows } = require('@dataflows/sms');

What you can do

| Call | What it does | |---|---| | client.account.profile() | Your account details | | client.account.balance() | Your remaining balance | | client.senderIds.list() | Your active sender IDs | | client.sms.send({ recipient, senderId, message, scheduleTime }) | Send or schedule an SMS | | client.sms.list({ page, limit }) | A page of your sent messages | | client.sms.get(uid) | One message | | client.groups.list({ page }) | A page of your contact groups | | client.groups.create({ name }) | Add a group | | client.groups.get(groupUid) | One group | | client.groups.update(groupUid, { name }) | Rename a group | | client.groups.delete(groupUid) | Delete a group | | client.contacts.list(groupUid, { page }) | A page of a group's contacts | | client.contacts.create(groupUid, { phone, firstName, lastName, fields }) | Add a contact | | client.contacts.get(groupUid, contactUid) | One contact | | client.contacts.update(groupUid, contactUid, { phone, firstName, lastName, fields }) | Change a contact | | client.contacts.delete(groupUid, contactUid) | Delete a contact |

Sending

Numbers go in international format, such as 61404235133. A number containing letters is refused before anything is sent.

Several numbers: pass a list as recipient. They're sent during the request, so a long list takes longer, and you get one result per number.

Scheduling: set scheduleTime to YYYY-MM-DD HH:mm in your account's timezone.

Delivery status: a message's customer_status of Delivered means the carrier accepted it. It doesn't confirm the message reached the phone.

Trial accounts can only send to numbers they have verified.

Contacts

Adding a contact sends the group's welcome text if you've set one up on that group. fields holds your group's custom fields, by tag. Leave phone out of an update to keep the current number.

Errors

Every failure throws a DataFlowsError. This includes errors the API answers with HTTP 200, which many of them do.

import { DataFlows, DataFlowsError } from '@dataflows/sms';

try {
  await client.sms.send({ recipient: '61404235133', senderId: 'YOUR_SENDER_ID', message: 'Hello' });
} catch (error) {
  if (error instanceof DataFlowsError) {
    console.error(error.code, error.httpStatus, error.message);
  } else {
    throw error;
  }
}

| error.code | Meaning | |---|---| | api_error | DataFlows refused the request. error.message says why | | invalid_input | Something is missing or wrong. Nothing was sent to DataFlows | | rate_limited | Over 600 requests per minute for this token | | timeout | No answer in time. A send may still have gone out | | network_error | DataFlows couldn't be reached | | invalid_response | DataFlows sent back something unexpected |

Nothing is retried automatically, so a message can't go out twice because of this client. After a timeout, check client.sms.list() before you send again.

Options

const client = new DataFlows({
  apiToken: 'your-token', // defaults to DATAFLOWS_API_TOKEN
  timeout: 60000,         // milliseconds per request, this is the default
});

More

License

MIT