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

waland

v0.1.2

Published

Official Node.js SDK for the Waland WhatsApp API

Readme

waland

Official Node.js SDK for the Waland API. Send WhatsApp messages with your organization API key and session.

Requires Node.js 18+

Install

npm install waland

API key and session ID

Open the Waland merchant console and set up both credentials:

API key

Create or copy your organization API key (starts with waland_) from the console.

Session ID

  1. In the console, go to the WhatsApp accounts page.
  2. Connect your WhatsApp account by scanning the QR code with the WhatsApp app on your phone.
  3. After the account is connected, copy the session ID for that account.

Use that session ID when creating the client.

Keep your API key and session ID secret. Use environment variables in production (e.g. WALAND_API_KEY, WALAND_SESSION_ID).

Quick start

import { WalandClient } from "waland";

const client = new WalandClient(
  process.env.WALAND_API_KEY!,
  process.env.WALAND_SESSION_ID!,
);

const result = await client.sendMessage({
  chatId: "[email protected]",
  text: "Hello from Waland",
});

console.log(result.status, result.messageId);

Constructor

new WalandClient(apiKey, sessionId, options?)

| Argument | Description | | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | | apiKey | Organization API key (waland_...) from the merchant console | | sessionId | Session ID from WhatsApp accounts in the merchant console (after connecting via QR code) | | options.baseUrl | API base URL (default: https://api.waland.dev) | | options.timeoutMs | Request timeout in ms (default: 30000) |

sendMessage(params)

| Field | Required | Description | | --------------- | -------- | ------------------------------------------------------------------------ | | chatId | Yes | WhatsApp JID: {number}@s.whatsapp.net (DM) or {groupId}@g.us (group) | | text | No* | Message body or media caption | | mediaUrl | No* | Public HTTPS URL of media to send | | mediaFilename | No | Filename override for downloaded media |

At least one of text or mediaUrl must be provided.

Media example

await client.sendMessage({
  chatId: "[email protected]",
  text: "Check this out",
  mediaUrl: "https://example.com/photo.jpg",
  mediaFilename: "photo.jpg",
});

checkNumber(params)

Checks whether a phone number is available on WhatsApp for the current session.

| Field | Required | Description | | -------- | -------- | -------------------------------------------- | | number | Yes | Phone number in international format (digits) |

const result = await client.checkNumber({ number: "8801712345678" });
console.log(result.exists ?? result.isWhatsApp ?? result.onWhatsApp);

Errors

  • WalandValidationError — invalid arguments before the request is sent
  • WalandError — API returned a non-success status (statusCode, message, body)
import { WalandClient, WalandError } from "waland";

try {
  await client.sendMessage({ chatId: "...", text: "Hi" });
} catch (error) {
  if (error instanceof WalandError) {
    console.error(error.statusCode, error.message);
  }
}

Multiple sessions

Use one client per session (same API key is fine):

const support = new WalandClient(apiKey, supportSessionId);
const alerts = new WalandClient(apiKey, alertsSessionId);