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

@wazen/sdk

v0.4.0

Published

Official TypeScript/Node.js SDK for the Wazen WhatsApp API

Readme

Wazen Node.js / TypeScript SDK

Official TypeScript SDK for the Wazen WhatsApp API.

npm TypeScript

Installation

npm install @wazen/sdk
bun add @wazen/sdk
yarn add @wazen/sdk

Quick Start

import { Wazen } from "@wazen/sdk";

const wazen = new Wazen("wz_your_api_key");

// Send a message
const message = await wazen.messages.send("session-id", {
  to: "+1234567890",
  type: "text",
  content: "Hello from Wazen!",
});

// List sessions
const sessions = await wazen.sessions.list();

// Check if a number is on WhatsApp
const result = await wazen.contacts.check("session-id", {
  phone: "+1234567890",
});

Resources

All resources are accessible as properties on the client instance.

Sessions

await wazen.sessions.create();
await wazen.sessions.list();
await wazen.sessions.get("session-id");
await wazen.sessions.delete("session-id");
await wazen.sessions.restart("session-id");
await wazen.sessions.getQr("session-id");
await wazen.sessions.factoryReset("session-id");

Messages

// Send text
await wazen.messages.send("session-id", {
  to: "+1234567890",
  type: "text",
  content: "Hello!",
});

// Send image
await wazen.messages.send("session-id", {
  to: "+1234567890",
  type: "image",
  media_url: "https://example.com/photo.jpg",
});

// Get message history
await wazen.messages.list("session-id", { direction: "outgoing", limit: 10 });

// Get single message
await wazen.messages.get("session-id", "message-id");

Groups

await wazen.groups.list("session-id");
await wazen.groups.create("session-id", {
  subject: "Team Chat",
  participants: ["+1234567890"],
});
await wazen.groups.get("session-id", "group-id");
await wazen.groups.update("session-id", "group-id", { subject: "New Name" });
await wazen.groups.leave("session-id", "group-id");
await wazen.groups.manageParticipants("session-id", "group-id", {
  action: "add",
  participants: ["+0987654321"],
});
await wazen.groups.sendMessage("session-id", "group-id", {
  type: "text",
  content: "Hello group!",
});
await wazen.groups.getInvite("session-id", "group-id");
await wazen.groups.revokeInvite("session-id", "group-id");
await wazen.groups.getRequests("session-id", "group-id");
await wazen.groups.manageRequests("session-id", "group-id", {
  participants: ["[email protected]"],
  action: "approve",
});
await wazen.groups.updateSettings("session-id", "group-id", {
  setting: "announcement",
});
await wazen.groups.getInviteInfo("session-id", { code: "ABC123" });
await wazen.groups.join("session-id", { code: "ABC123" });

Channels

await wazen.channels.create("session-id", {
  name: "Product Updates",
  description: "Latest news",
});
await wazen.channels.lookup("session-id", { jid: "channel@newsletter" });
await wazen.channels.get("session-id", "channel-id");
await wazen.channels.update("session-id", "channel-id", { name: "New Name" });
await wazen.channels.delete("session-id", "channel-id");
await wazen.channels.sendMessage("session-id", "channel-id", {
  type: "text",
  content: "New release!",
});
await wazen.channels.listMessages("session-id", "channel-id", { count: 10 });
await wazen.channels.react("session-id", "channel-id", "msg-id", { reaction: "👍" });
await wazen.channels.follow("session-id", "channel-id");
await wazen.channels.unfollow("session-id", "channel-id");
await wazen.channels.mute("session-id", "channel-id");
await wazen.channels.unmute("session-id", "channel-id");

Contacts

// Check single number
await wazen.contacts.check("session-id", { phone: "+1234567890" });

// Bulk check
await wazen.contacts.bulkCheck("session-id", {
  phones: ["+1234567890", "+0987654321"],
});

Warming

await wazen.warming.start("session-id", {
  contacts: [
    { phone: "+1234567890", name: "Alice" },
    { phone: "+0987654321" },
  ],
});
await wazen.warming.getStatus("session-id");
await wazen.warming.pause("session-id");
await wazen.warming.resume("session-id");
await wazen.warming.cancel("session-id");

Webhooks

await wazen.webhooks.create({
  url: "https://your-app.com/webhooks/wazen",
  events: ["message.received", "message.delivered"],
});
await wazen.webhooks.list();
await wazen.webhooks.update("webhook-id", { enabled: false });
await wazen.webhooks.delete("webhook-id");
await wazen.webhooks.test("webhook-id");
await wazen.webhooks.getLogs("webhook-id");

Account

const account = await wazen.account.get();
const usage = await wazen.account.getUsage();

API Keys

const key = await wazen.apiKeys.create({ name: "new-key" });
await wazen.apiKeys.list();
await wazen.apiKeys.revoke("key-id");

Configuration

const wazen = new Wazen("wz_your_api_key", {
  baseUrl: "https://wazen.dev/api/v1", // default
  timeout: 30000, // request timeout in ms, default 30s
});

Error Handling

import { Wazen, WazenApiError } from "@wazen/sdk";

try {
  await wazen.messages.send("session-id", { to: "+1234567890", type: "text", content: "Hi" });
} catch (error) {
  if (error instanceof WazenApiError) {
    console.error(error.status);   // HTTP status code
    console.error(error.code);     // API error code
    console.error(error.message);  // Error message
  }
}

Requirements

  • Node.js 18+ or Bun 1.0+
  • A Wazen account with an active subscription
  • An API key from your Dashboard

Links

License

MIT