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 🙏

© 2025 – Pkg Stats / Ryan Hefner

visper-baileys

v1.0.0

Published

WhatsApp API

Readme

🚀 BAILEYS-ELITE

TypeScript JavaScript WhatsApp NPM


🔮 | WHY BAILEYS-ELITE?

📌 | IMPORTANT NOTE

💫 | INSTALLATION

📂 In package.json:

"dependencies": {
    "baileys-elite": "*"
}

⚙️ Terminal Installation:

npm install baileys-elite

🔌 Import:

// ESM 
import makeWASocket from 'baileys-elite'
// CommonJS
const { default: makeWASocket } = require("baileys-elite")

✨ | FEATURE SHOWCASE

🎀 Enhanced Features Matrix

| Feature | Description | Status | |---------|-------------|--------| | 🔊 Channel Messaging | Send & manage WhatsApp channel content | ✅ | | 🎛️ Interactive Messages | Create rich button-based experiences | ✅ | | 🤖 AI Message Icon | Brand your bot messages with AI icon | ✅ | | 🖼️ Enhanced Media | Uncropped profile pictures & optimized media | ✅ | | 🔐 Custom Pairing | Personalized device pairing codes | ✅ | | 🔧 Performance Optimizations | Cleaner logs & improved signal handling | ✅ | | 📱 Cross-Platform | Works on all NodeJS supported platforms | ✅ |

📰 | NEWSLETTER MANAGEMENT

📊 Get Newsletter Info

// By invite
const metadata = await sock.newsletterMetadata("invite", "xxxxx")
// By JID
const metadata = await sock.newsletterMetadata("jid", "abcd@newsletter")
console.log(metadata)

📝 Update Newsletter Content

// Update description
await sock.newsletterUpdateDescription("abcd@newsletter", "New Description")

// Update name
await sock.newsletterUpdateName("abcd@newsletter", "New Name")

// Update picture
await sock.newsletterUpdatePicture("abcd@newsletter", buffer)

// Remove picture
await sock.newsletterRemovePicture("abcd@newsletter")

🔔 Notification Management

// Unmute newsletter
await sock.newsletterUnmute("abcd@newsletter")

// Mute newsletter
await sock.newsletterMute("abcd@newsletter")

🔄 Newsletter Management

// Create new newsletter
const metadata = await sock.newsletterCreate("Newsletter Name", "Newsletter Description")
console.log(metadata)

// Delete newsletter
await sock.newsletterDelete("abcd@newsletter")

// Follow newsletter
await sock.newsletterFollow("abcd@newsletter")

// Unfollow newsletter
await sock.newsletterUnfollow("abcd@newsletter")

😀 Engagement Features

// Send reaction to newsletter post
// Get ID from message URL: https://whatsapp.com/channel/xxxxx/175
const id = "175"
await sock.newsletterReactMessage("abcd@newsletter", id, "🥳")

🎛️ | INTERACTIVE MESSAGING

📝 Text Buttons

const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

const buttonMessage = {
    text: "Hi it's button message",
    footer: 'Hello World',
    buttons,
    headerType: 1,
    viewOnce: true
}

await sock.sendMessage(id, buttonMessage, { quoted: null })

🖼️ Image Buttons

const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

const buttonMessage = {
    image: { url: "https://example.com/abcd.jpg" }, // image: buffer or path
    caption: "Hi it's button message with image",
    footer: 'Hello World',
    buttons,
    headerType: 1,
    viewOnce: true
}

await sock.sendMessage(id, buttonMessage, { quoted: null })

🎬 Video Buttons

const buttons = [
  { buttonId: 'id1', buttonText: { displayText: 'Button 1' }, type: 1 },
  { buttonId: 'id2', buttonText: { displayText: 'Button 2' }, type: 1 }
]

const buttonMessage = {
    video: { url: "https://example.com/abcd.mp4" }, // video: buffer or path
    caption: "Hi it's button message with video",
    footer: 'Hello World',
    buttons,
    headerType: 1,
    viewOnce: true
}

await sock.sendMessage(id, buttonMessage, { quoted: null })

🔄 Advanced Interactive Messages

const interactiveButtons = [
     {
        name: "quick_reply",
        buttonParamsJson: JSON.stringify({
             display_text: "Quick Reply",
             id: "ID"
        })
     },
     {
        name: "cta_url",
        buttonParamsJson: JSON.stringify({
             display_text: "Tap Here!",
             url: "https://www.example.com/"
        })
     },
     {
        name: "cta_copy",
        buttonParamsJson: JSON.stringify({
             display_text: "Copy Code",
             id: "12345",
             copy_code: "12345"
        })
     }
]

const interactiveMessage = {
    text: "Hello World!",
    title: "this is the title",
    footer: "this is the footer",
    interactiveButtons
}

await sock.sendMessage(id, interactiveMessage, { quoted: null })

🖼️ Rich Media Interactive Messages

const interactiveButtons = [
     {
        name: "quick_reply",
        buttonParamsJson: JSON.stringify({
             display_text: "Quick Reply",
             id: "ID"
        })
     },
     {
        name: "cta_url",
        buttonParamsJson: JSON.stringify({
             display_text: "Visit Website",
             url: "https://www.example.com/"
        })
     }
]

// With Image
const imageInteractiveMessage = {
    image: { url: "https://example.com/abcd.jpg" },
    caption: "Check out this amazing photo!",
    title: "Photo Showcase",
    footer: "Tap a button below",
    interactiveButtons
}

await sock.sendMessage(id, imageInteractiveMessage, { quoted: null })

// With Video
const videoInteractiveMessage = {
    video: { url: "https://example.com/abcd.mp4" },
    caption: "Watch this awesome video!",
    title: "Video Showcase",
    footer: "Tap a button below",
    interactiveButtons
}

await sock.sendMessage(id, videoInteractiveMessage, { quoted: null })

🤖 | AI MESSAGING

AI Icon Feature

// Simply add "ai: true" to display AI icon with your message
await sock.sendMessage(id, { text: "Hello! I'm your AI assistant.", ai: true })

🔐 | CUSTOM PAIRING

Custom Code Implementation

if(usePairingCode && !sock.authState.creds.registered) {
    const phoneNumber = await question('Please enter your mobile phone number:\n')
    const custom = "SH1Z0D3V" // must be 8 digits, can be letters or numbers
    const code = await sock.requestPairingCode(phoneNumber, custom)
    console.log(`Pairing code: ${code?.match(/.{1,4}/g)?.join('-') || code}`)
}

🛠️ | QUICK IMPLEMENTATION GUIDE

🐛 | REPORTING ISSUES

📝 | NOTES