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

chat-adapter-baileys

v2.1.0

Published

WhatsApp (Baileys) adapter for Chat SDK

Downloads

12,320

Readme

chat-adapter-baileys

chat-adapter-baileys

WhatsApp (Baileys) adapter for the Chat SDK. Run Chat SDK bots on WhatsApp — connection, message parsing, formatting, media, reactions, and typing indicators included.

[!WARNING] Baileys is an unofficial WhatsApp Web API, not an official WhatsApp/Meta API. It may break when WhatsApp changes its protocol, and WhatsApp may ban numbers using unofficial automation. Use at your own risk.

Install

pnpm add chat-adapter-baileys baileys chat @chat-adapter/state-memory

Quick Start

import { Chat } from "chat";
import { createMemoryState } from "@chat-adapter/state-memory";
import { useMultiFileAuthState } from "baileys";
import { createBaileysAdapter } from "chat-adapter-baileys";

const { state, saveCreds } = await useMultiFileAuthState("./auth_info");

const whatsapp = createBaileysAdapter({
  auth: { state, saveCreds },
  userName: "my-bot",
  onQR: (qr) => console.log(qr), // scan with WhatsApp → Linked Devices
});

const bot = new Chat({
  userName: "my-bot",
  adapters: { whatsapp },
  state: createMemoryState(),
});

// Register handlers BEFORE connecting — messages arrive as soon as connect() runs
bot.onNewMention(async (thread, message) => {
  await thread.post(`Hello ${message.author.userName}!`);
  await thread.subscribe();
});

bot.onSubscribedMessage(async (thread, message) => {
  // Ignore messages posted by this adapter to avoid feedback loops.
  if (message.author.isMe) return;
  await thread.post(`You said: ${message.text}`);
});

await bot.initialize();
await whatsapp.connect();

Credentials are saved to ./auth_info on first login and reused on later startups — no QR rescan needed.

Documentation

Full docs are hosted at rama-adi.dev/docs/chat-adapter-baileys (source in docs/):

Support Overview

Chat SDK Base

| Feature | Support | |---|---| | Post message | ✅ | | Edit message | ✅ | | Delete message | ✅ | | Add reactions | ✅ | | Remove reactions | ✅ | | Observe reactions | ✅ | | Typing indicator | ✅ | | DMs | ✅ | | Fetch thread info | ✅ | | Fetch channel info | ✅ | | Post channel message | ✅ | | Fetch messages | ⚠️ Returns empty unless you persist your own history | | Fetch single message | ❌ | | Fetch channel messages | ⚠️ Returns empty unless you persist your own history | | List threads | ❌ | | Streaming | ❌ | | Scheduled messages | ❌ | | Slash commands | ❌ | | Modals | ❌ | | Ephemeral messages | ❌ |

Baileys Extras

WhatsApp-specific methods on the concrete adapter — see Extensions.

| Method | Description | |---|---| | reply(message, text) | Send a quoted reply (native WhatsApp reply bubble) | | markRead({ threadId, messageIds, participant? }) | Send read receipts (blue double-ticks) | | setPresence("available" \| "unavailable") | Set bot's global online/offline status | | sendLocation({ threadId, latitude, longitude, name?, address? }) | Send a native location pin | | sendPoll({ threadId, question, options, selectableCount?, metadata? }) | Send a WhatsApp poll | | fetchGroupParticipants(threadId) | List group members with admin roles |

Development

pnpm typecheck
pnpm test
pnpm build

License

MIT