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

@sendapi/node

v1.0.0

Published

Official SendAPI Node.js SDK — SMS, Email, WhatsApp, and OTP APIs

Readme

@sendapi/node

Official Node.js SDK for SendAPI — send SMS, Email, WhatsApp messages, and OTP verification through one API.

npm version License: MIT

Installation

npm install @sendapi/node

Quick Start

import 'dotenv/config'
import SendAPI from '@sendapi/node'

const client = new SendAPI(process.env.SENDAPI_KEY)

// Send a WhatsApp message
const message = await client.whatsapp.send({
  session_id: process.env.WHATSAPP_SESSION_ID,
  to: '14155552671',
  type: 'text',
  text: 'Hello from SendAPI! 👋',
})

console.log('Sent:', message.message_id)

Features

  • WhatsApp — Send text, image, document, audio and video messages
  • SMS — Send single or bulk SMS worldwide
  • Email — Transactional email with HTML support
  • OTP Verification — Send and verify one-time passwords
  • Webhooks — Built-in signature verification
  • TypeScript — Full type definitions included
  • Zero dependencies — Uses native fetch (Node 18+)

Usage

SMS

await client.sms.send({
  to: '+14155552671',
  content: 'Your verification code is 847291',
})

Email

await client.email.send({
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Welcome!',
  html: '<h1>Welcome to MyApp!</h1>',
})

WhatsApp

await client.whatsapp.send({
  session_id: 'your-session-id',
  to: '14155552671',
  type: 'text',
  text: 'Hello from SendAPI!',
})

OTP Verification

// Send OTP
const verification = await client.verify.send({
  to: '+14155552671',
  channel: 'sms',
  brand_name: 'MyApp',
})

// Check OTP
const result = await client.verify.check({
  id: verification.id,
  code: '847291',
})

if (result.valid) {
  // Authenticated
}

Webhook Signature Verification

import { verifyWebhookSignature } from '@sendapi/node'

app.post('/webhook', express.raw({ type: 'application/json' }), (req, res) => {
  const signature = req.headers['x-sendapi-signature']

  if (!verifyWebhookSignature(req.body, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(401).json({ error: 'Invalid signature' })
  }

  const event = JSON.parse(req.body.toString())
  console.log('Event:', event.event)
  res.json({ received: true })
})

Error Handling

import { SendAPIError } from '@sendapi/node'

try {
  await client.whatsapp.send({ /* ... */ })
} catch (err) {
  if (err instanceof SendAPIError) {
    console.log(err.status)   // 429
    console.log(err.code)     // "rate_limit_exceeded"
    console.log(err.message)  // "Too many requests"
  }
}

Configuration

const client = new SendAPI('your-api-key', {
  baseUrl: 'https://api.sendapi.co/api/v1', // default
  timeout: 30000, // request timeout in ms
})

Requirements

  • Node.js 18 or later (uses native fetch)

Documentation

Full API reference at sendapi.co/docs

License

MIT — see LICENSE