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

@sdkwa/whatsapp-api-client

v1.0.18

Published

Multi-messenger TypeScript SDK for WhatsApp and Telegram - Unified API for both platforms with dynamic messenger selection

Readme

SDKWA Multi-Messenger API Client for JavaScript

build License npm version

A modern JavaScript/TypeScript SDK for integrating with multiple messenger platforms through the SDKWA HTTP API.

Supported Messengers:

  • 🟢 WhatsApp - Full support for messaging, media, groups, and webhooks
  • 🔵 Telegram - Full support for messaging, app creation, and authentication

Switch between messengers with a single parameter. All 40+ API methods work with both platforms.


Installation

npm install @sdkwa/whatsapp-api-client

Quick Start

1. Link Your Account (Required First)

⚠️ Before sending messages, scan QR code with your mobile app:

import SDKWA from "@sdkwa/whatsapp-api-client";

const sdkwa = new SDKWA({
  idInstance: "YOUR_ID_INSTANCE",
  apiTokenInstance: "YOUR_API_TOKEN_INSTANCE"
});

// Get QR code
const qrCode = await sdkwa.getQr();
console.log(qrCode.message); // base64 image - scan with WhatsApp/Telegram app

// Check authorization
const state = await sdkwa.getStateInstance();
console.log(state.stateInstance); // "authorized" when ready

📱 WhatsApp: Settings → Linked Devices → Link a Device
📱 Telegram: Settings → Devices → Link Desktop Device


2. Send Messages

// Send to WhatsApp (default)
await sdkwa.sendMessage({
  chatId: "[email protected]",
  message: "Hello WhatsApp!"
});

// Send to Telegram (override)
await sdkwa.sendMessage({
  chatId: "@username",
  message: "Hello Telegram!"
}, 'telegram');

3. Receive Messages (Webhooks)

import express from "express";

const app = express();
app.use(express.json());

sdkwa.webhookHandler.onIncomingMessageText((data) => {
  console.log("Received:", data);
});

app.post("/webhook", sdkwa.webhookHandler.webhookHandler());
app.listen(3000);

Messenger Selection

// Set default messenger
const sdkwa = new SDKWA({
  idInstance: "YOUR_ID",
  apiTokenInstance: "YOUR_TOKEN",
  messenger: "whatsapp" // or "telegram"
});

// Use default
await sdkwa.getSettings();

// Override per call
await sdkwa.getSettings('telegram');
await sdkwa.sendMessage(params, 'telegram');

All 40+ methods support both messengers: Account, Messaging, Files, Groups, Contacts, Notifications, etc.


Telegram App Creation

// 1. Send confirmation code
await sdkwa.sendConfirmationCode({ phoneNumber: 712345678989 });

// 2. Sign in with code
await sdkwa.signInWithConfirmationCode({ code: "received_code" });

// 3. Create app
await sdkwa.createApp({
  title: "My App",
  shortName: "myapp",
  url: "https://sdkwa.pro",
  description: "My app"
});

Examples


Links


License

MIT