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

@anuragwhatsapppapi22/whatsapp-api

v1.0.0

Published

A WebSockets based WhatsApp Web API by Anurag Mishra (rebranded fork of Baileys) for building bots and automations.

Downloads

126

Readme

@anuragmishra/whatsapp-api

A WebSockets based WhatsApp Web API by Anurag Mishra for building bots, automations and integrations on top of WhatsApp.

This package is a rebranded fork of the excellent Baileys library by Rajeh Taher / WhiskeySockets, repackaged and maintained by Anurag Mishra for personal and project use. Full credit for the original implementation goes to the Baileys team.

npm version License: MIT


✨ Features

  • Connects to WhatsApp Web directly via WebSockets — no Selenium / Puppeteer / Chromium required, so it is fast and lightweight.
  • Multi-device login via QR code or pairing code.
  • Send & receive text, images, videos, audio, documents, stickers, contacts, locations.
  • Group create / update / participants management.
  • Status (story) viewing & posting.
  • Reactions, polls, read receipts, typing & presence updates.
  • Newsletters / channels support.
  • Pluggable auth state (multi-file, custom store) and signal key store.
  • Fully typed in TypeScript.

📦 Installation

npm install @anuragmishra/whatsapp-api
# or
yarn add @anuragmishra/whatsapp-api
# or
pnpm add @anuragmishra/whatsapp-api

Requires Node.js >= 20.

Optional peer dependencies

Depending on what you use, install:

npm install sharp jimp link-preview-js audio-decode

🚀 Quick Start

import makeWASocket, {
  DisconnectReason,
  useMultiFileAuthState,
  fetchLatestBaileysVersion
} from '@anuragmishra/whatsapp-api'
import { Boom } from '@hapi/boom'

async function startBot() {
  const { state, saveCreds } = await useMultiFileAuthState('auth_info')
  const { version } = await fetchLatestBaileysVersion()

  const sock = makeWASocket({
    version,
    auth: state,
    printQRInTerminal: true
  })

  sock.ev.on('creds.update', saveCreds)

  sock.ev.on('connection.update', (update) => {
    const { connection, lastDisconnect } = update
    if (connection === 'close') {
      const shouldReconnect =
        (lastDisconnect?.error as Boom)?.output?.statusCode !==
        DisconnectReason.loggedOut
      console.log('connection closed, reconnecting:', shouldReconnect)
      if (shouldReconnect) startBot()
    } else if (connection === 'open') {
      console.log('✅ Connected to WhatsApp')
    }
  })

  sock.ev.on('messages.upsert', async ({ messages }) => {
    const msg = messages[0]
    if (!msg.message || msg.key.fromMe) return

    const text =
      msg.message.conversation || msg.message.extendedTextMessage?.text || ''

    if (text.toLowerCase() === 'ping') {
      await sock.sendMessage(msg.key.remoteJid!, { text: 'pong 🏓' })
    }
  })
}

startBot()

📤 Sending messages

// Text
await sock.sendMessage(jid, { text: 'Hello from Anurag Mishra WA API!' })

// Image
await sock.sendMessage(jid, {
  image: { url: './photo.jpg' },
  caption: 'Look at this 📸'
})

// Document
await sock.sendMessage(jid, {
  document: { url: './report.pdf' },
  mimetype: 'application/pdf',
  fileName: 'report.pdf'
})

// Reply
await sock.sendMessage(jid, { text: 'reply!' }, { quoted: originalMsg })

// Reaction
await sock.sendMessage(jid, {
  react: { text: '🔥', key: originalMsg.key }
})

👥 Group helpers

const group = await sock.groupCreate('My Group', ['[email protected]'])
await sock.groupParticipantsUpdate(group.id, ['[email protected]'], 'add')
await sock.groupUpdateSubject(group.id, 'New Group Name')

🔐 Auth — pairing code (no QR)

const sock = makeWASocket({ auth: state })

if (!sock.authState.creds.registered) {
  const code = await sock.requestPairingCode('9198xxxxxxxx')
  console.log('Pairing code:', code)
}

⚠️ Disclaimer

  • This library is NOT affiliated with, endorsed by, or sponsored by WhatsApp / Meta.
  • Using unofficial WhatsApp clients can violate WhatsApp's Terms of Service. Your number may be banned if it is used for spam or abuse.
  • Use at your own risk. For business / production grade messaging, prefer the official WhatsApp Business Cloud API by Meta.
  • This is a personal rebrand by Anurag Mishra of the open-source Baileys library, distributed under the same MIT license.

🙏 Credits

Massive thanks to:


📝 License

MIT © 2026 Anurag Mishra Originally based on Baileys © 2025 Rajeh Taher / WhiskeySockets.