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

warsita

v0.2.1

Published

Official Node.js client for the Warsita WhatsApp API: send messages, manage sessions, contacts and groups, and verify webhooks.

Readme

Warsita for Node.js

The official Node.js client for the Warsita WhatsApp API: send messages, manage sessions, contacts and groups, and verify webhooks. TypeScript types come straight from the OpenAPI spec.

npm install warsita

Node.js 20 or newer. No runtime dependencies.

Send a message

import Warsita from "warsita";

const warsita = new Warsita({ apiKey: process.env.WARSITA_API_KEY }); // the session's wsk_… key

const message = await warsita.messages.send({ to: "+6281234567890", text: "Your order has shipped." });
console.log(message.id, message.status); // msg_… queued

Every send carries an Idempotency-Key (generated, or pass { idempotencyKey }), so the client retries rate limits and dropped connections without sending twice.

import { readFile } from "node:fs/promises";

await warsita.messages.send({ to: "[email protected]", image: { url: "https://example.com/receipt.png", caption: "Receipt" } });
await warsita.messages.send({ to: "+6281234567890", poll: { name: "Which day?", options: ["Friday", "Saturday"], selectable_count: 1 } });

const file = await warsita.media.upload(await readFile("invoice.pdf"), { filename: "invoice.pdf", contentType: "application/pdf" });
await warsita.messages.send({ to: "+6281234567890", document: { media_id: file.id } });

Personal access tokens

A session API key (wsk_…) acts for its own session. A personal access token (wsp_…) acts for the whole workspace and manages sessions; name the session for messaging calls:

const warsita = new Warsita({ apiKey: process.env.WARSITA_TOKEN, sessionId: "ses_3kV9mQ2pX7aL0zR5tN8w" });
const sessions = await warsita.sessions.list();
await warsita.groups.list({ sessionId: sessions[1].id }); // or per call

With several numbers, a token can let Warsita pick one per message (sender rotation): of the sessions with the rotation setting on, the one that wrote to this person longest ago.

const message = await warsita.messages.send({ rotate: true, to: "+6281234567890", text: "Your invoice is due on 1 November." });
console.log(message.from, message.session_id);
await warsita.messages.get(message.id); // no session needed

Sessions can be private to the member who creates them: warsita.sessions.create({ name: "My number", visibility: "private" }).

Receive webhooks

Pass the raw body, not parsed JSON:

import express from "express";
import { verifyWebhook } from "warsita";

app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const event = verifyWebhook(req.body, req.get("X-Warsita-Signature"), process.env.WARSITA_WEBHOOK_SECRET);
  if (event.event === "messages.received") console.log(event.data.text);
  res.sendStatus(200);
});

verifyWebhook throws on a wrong signature or one older than five minutes.

What's included

| | | | --- | --- | | messages | send, list, get, edit, delete, resend, react, markRead | | media | upload, get | | account | get, setPresence, setChatPresence | | contacts | list, check, get, picture, ids, block, unblock, blocklist | | groups | list, get, create, update, updateParticipants, setPicture, inviteLink, resetInviteLink, inviteInfo, join, leave | | sessions | list, create, get, update, delete, connect, restart, disconnect, qr, pairingCode, regenerateApiKey, logs, clearMessages, events (live stream) | | sessions.webhook | get, set, rotateSecret, test, deliveries, resend |

Responses that hold only data are unwrapped. Errors are WarsitaError with the API's status, code and message (and retryAfter on rate limits). The full reference is at warsita.com/docs, with an SDK guide at warsita.com/docs/sdks.

Development

openapi.yaml is a copy of the published spec; npm run update-spec refreshes it and the generated types (src/schema.ts). npm test builds and checks that every operation in the spec has a method.