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

@rakku-kun/baileys

v2.0.31

Published

๐ŸŒฟ Rakku Baileys - Modern WhatsApp Multi-Device API with enhanced JID/LID mapping & clean architecture.

Downloads

3,774

Readme


โœฆ Fitur Utama

Fitur Inti

  • โ–ถ Pemetaan @lid dan @jid Cerdas - Resolusi konversi otomatis dari LID ke JID secara seamless
  • โ–ถ Dukungan Multi-Device - Kompatibel penuh dengan protokol WhatsApp multi-device
  • โ–ถ Enkripsi End-to-End - Keamanan E2E bawaan untuk menjaga privasi komunikasi
  • โ–ถ Semua Jenis Pesan - Mendukung teks, media, polling, reaksi, dll.
  • โ–ถ Berbasis TypeScript - Dikembangkan dengan keamanan tipe standar modern

Fitur Lanjutan

  • โ–ถ Pengolahan Media - Kirim gambar, video, pesan suara, stiker, hingga dokumen
  • โ–ถ Login Kode Pairing - Autentikasi menggunakan kode pairing "RAKKUWTR"
  • โ–ถ Dukungan Saluran/Newsletter - Pengelolaan dan interaksi Saluran WhatsApp
  • โ–ถ Manajemen Grup - Kontrol penuh untuk administrasi grup
  • โ–ถ Pesan Polling & Reaksi - Buat polling interaktif dan deteksi reaksi emoji

๐Ÿ“ฆ Instalasi

npm

npm install @rakku-kun/baileys

yarn

yarn add @rakku-kun/baileys

pnpm

pnpm add @rakku-kun/baileys

๐Ÿš€ Quick Start

Basic Example

import makeWASocket, { DisconnectReason, useMultiFileAuthState } from '@rakku-kun/baileys'
import { Boom } from '@hapi/boom'

async function connectToWhatsApp() {
    const { state, saveCreds } = await useMultiFileAuthState('session_rakku')

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

    sock.ev.on('connection.update', (update) => {
        const { connection, lastDisconnect } = update
        if (connection === 'close') {
            const shouldReconnect = (lastDisconnect?.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut
            if (shouldReconnect) {
                connectToWhatsApp()
            }
        } else if (connection === 'open') {
            console.log('โœ… Connected to WhatsApp!')
        }
    })

    sock.ev.on('messages.upsert', async ({ messages }) => {
        for (const m of messages) {
            if (!m.message) continue
            console.log('๐Ÿ“ฑ New message:', m.key.remoteJid)

            // Reply to message
            await sock.sendMessage(m.key.remoteJid!, {
                text: 'Hello! I am Rakku Bot ๐ŸŒฟ'
            })
        }
    })

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

connectToWhatsApp()

๐Ÿ” Authentication

Pairing Code (Recommended)

import makeWASocket from '@rakku-kun/baileys'

const sock = makeWASocket({
    printQRInTerminal: false
})

// Request pairing code
if (!sock.authState.creds.registered) {
    const phoneNumber = '628xxxxxxxxxx' // Your phone number with country code
    const code = await sock.requestPairingCode(phoneNumber, "RAKKUWTR")
    console.log('๐ŸŒฟ Pairing Code:', code)
}

QR Code

import makeWASocket, { Browsers } from '@rakku-kun/baileys'

const sock = makeWASocket({
    browser: Browsers.ubuntu('Rakku Bot'),
    printQRInTerminal: true
})

๐Ÿ“š Common Use Cases

Send Text Message

await sock.sendMessage(jid, { text: 'Hello World! ๐ŸŒฟ' })

Send Image

await sock.sendMessage(jid, {
    image: { url: './image.jpg' },
    caption: 'Check this out!'
})

Send Video

await sock.sendMessage(jid, {
    video: { url: './video.mp4' },
    caption: 'Amazing video!',
    mimetype: 'video/mp4'
})

Send Audio

await sock.sendMessage(jid, {
    audio: { url: './audio.mp3' },
    mimetype: 'audio/mp4'
})

Send Sticker

await sock.sendMessage(jid, {
    sticker: { url: './sticker.webp' }
})

Send Document

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

Send Location

await sock.sendMessage(jid, {
    location: {
        degreesLatitude: -6.2088,
        degreesLongitude: 106.8456
    }
})

Send Contact

const vcard = `BEGIN:VCARD
VERSION:3.0
FN:Rakku Developer
TEL;type=CELL;type=VOICE;waid=6281234567890:+62 812-3456-7890
END:VCARD`

await sock.sendMessage(jid, {
    contacts: {
        displayName: 'Rakku Developer',
        contacts: [{ vcard }]
    }
})

Send Poll

await sock.sendMessage(jid, {
    poll: {
        name: 'Favorite Color?',
        values: ['Red', 'Blue', 'Green'],
        selectableCount: 1
    }
})

Send Reaction

await sock.sendMessage(jid, {
    react: {
        text: '๐ŸŒฟ',
        key: message.key
    }
})

Reply/Quote Message

await sock.sendMessage(jid, {
    text: 'This is a reply'
}, {
    quoted: message
})

Mention Users

await sock.sendMessage(jid, {
    text: 'Hello @6281234567890!',
    mentions: ['[email protected]']
})

Forward Message

await sock.sendMessage(jid, {
    forward: message
})

Delete Message (For Everyone)

const msg = await sock.sendMessage(jid, { text: 'test' })
await sock.sendMessage(jid, { delete: msg.key })

Edit Message

await sock.sendMessage(jid, {
    text: 'Updated text',
    edit: message.key
})

Pin Message

await sock.sendMessage(jid, {
    pin: {
        type: 1, // 1=24h, 2=7d, 3=30d
        time: 86400,
        key: message.key
    }
})

View Once Message

await sock.sendMessage(jid, {
    image: { url: './image.jpg' },
    viewOnce: true
})

๐Ÿ‘ฅ Group Management

Create Group

const group = await sock.groupCreate('My Group', ['[email protected]'])
console.log('Group created:', group.id)

Add Participants

await sock.groupParticipantsUpdate(groupId, ['[email protected]'], 'add')

Remove Participants

await sock.groupParticipantsUpdate(groupId, ['[email protected]'], 'remove')

Promote to Admin

await sock.groupParticipantsUpdate(groupId, ['[email protected]'], 'promote')

Demote Admin

await sock.groupParticipantsUpdate(groupId, ['[email protected]'], 'demote')

Update Group Name

await sock.groupUpdateSubject(groupId, 'New Group Name')

Update Group Description

await sock.groupUpdateDescription(groupId, 'New Description')

Get Invite Code

const code = await sock.groupInviteCode(groupId)
const inviteLink = 'https://chat.whatsapp.com/' + code

Join Group

await sock.groupAcceptInvite('inviteCode')

Leave Group

await sock.groupLeave(groupId)

๐Ÿ“ž Call Handling

Reject Call

sock.ev.on('call', async (calls) => {
    for (const call of calls) {
        await sock.rejectCall(call.id, call.from)
    }
})

๐Ÿ‘ค User Operations

Check If Number Exists on WhatsApp

const [result] = await sock.onWhatsApp('6281234567890')
if (result?.exists) {
    console.log('Number exists:', result.jid)
}

Get Profile Picture

// Low resolution
const ppUrl = await sock.profilePictureUrl(jid)

// High resolution
const ppUrl = await sock.profilePictureUrl(jid, 'image')

Get Status

const status = await sock.fetchStatus(jid)
console.log('About:', status?.status)

Get Business Profile

const profile = await sock.getBusinessProfile(jid)
console.log('Business:', profile)

๐Ÿ“ Chat Operations

Archive Chat

const lastMsg = await getLastMessage(jid)
await sock.chatModify({ archive: true, lastMessages: [lastMsg] }, jid)

Mute Chat

await sock.chatModify({ mute: 8 * 60 * 60 * 1000 }, jid) // 8 hours

Unmute Chat

await sock.chatModify({ mute: null }, jid)

Mark as Read

await sock.readMessages([message.key])

Delete Chat

await sock.chatModify({ delete: true, lastMessages: [lastMsg] }, jid)

Star Message

await sock.chatModify({
    star: {
        messages: [{ id: 'messageID', fromMe: true }],
        star: true
    }
}, jid)

Disappearing Messages

// Enable
await sock.sendMessage(jid, {
    disappearingMessagesInChat: 7 * 24 * 60 * 60 // 7 days
})

// Disable
await sock.sendMessage(jid, {
    disappearingMessagesInChat: false
})

๐ŸŽจ Profile Management

Update Profile Name

await sock.updateProfileName('New Name')

Update Profile Status

await sock.updateProfileStatus('New Status ๐ŸŒฟ')

Update Profile Picture

await sock.updateProfilePicture(jid, { url: './new-pp.jpg' })

Remove Profile Picture

await sock.removeProfilePicture(jid)

๐Ÿ“Š Events

Connection Events

sock.ev.on('connection.update', (update) => {
    console.log('Connection:', update)
})

Message Events

sock.ev.on('messages.upsert', ({ messages }) => {
    console.log('Messages:', messages)
})

sock.ev.on('messages.update', (updates) => {
    console.log('Message updates:', updates)
})

sock.ev.on('messages.delete', (deletes) => {
    console.log('Messages deleted:', deletes)
})

Chat Events

sock.ev.on('chats.upsert', (chats) => {
    console.log('New chats:', chats)
})

sock.ev.on('chats.update', (updates) => {
    console.log('Chat updates:', updates)
})

Contact Events

sock.ev.on('contacts.upsert', (contacts) => {
    console.log('New contacts:', contacts)
})

sock.ev.on('contacts.update', (updates) => {
    console.log('Contact updates:', updates)
})

Group Events

sock.ev.on('groups.upsert', (groups) => {
    console.log('New groups:', groups)
})

sock.ev.on('groups.update', (updates) => {
    console.log('Group updates:', updates)
})

sock.ev.on('group-participants.update', (update) => {
    console.log('Participants update:', update)
})

Presence Events

sock.ev.on('presence.update', (presence) => {
    console.log('Presence:', presence)
})

๐Ÿ—„๏ธ Data Store

In-Memory Store

import makeWASocket, { makeInMemoryStore } from '@rakku-kun/baileys'

const store = makeInMemoryStore()
store.readFromFile('./baileys_store.json')

setInterval(() => {
    store.writeToFile('./baileys_store.json')
}, 10000)

const sock = makeWASocket()
store.bind(sock.ev)

// Access stored data
console.log('Chats:', store.chats.all())
console.log('Contacts:', store.contacts)
console.log('Messages:', store.messages)

๐Ÿ”ง Utilities

JID Helpers

import { jidEncode, jidDecode, isJidGroup, isJidBroadcast } from '@rakku-kun/baileys'

// Encode JID
const jid = jidEncode('6281234567890', 's.whatsapp.net')

// Decode JID
const decoded = jidDecode(jid)

// Check JID type
const isGroup = isJidGroup(jid)
const isBroadcast = isJidBroadcast(jid)

Message Helpers

import { getContentType, getDevice, downloadMediaMessage } from '@rakku-kun/baileys'

// Get content type
const type = getContentType(message)

// Get device
const device = getDevice(message)

// Download media
const buffer = await downloadMediaMessage(message, 'buffer')

โœฆ Komunitas & Dukungan


โœฆ Penyangkalan (Disclaimer)

Library ini dikembangkan oleh komunitas Rakku Waiter bot. Gunakan dengan bijak dan selalu patuhi Syarat & Ketentuan Layanan WhatsApp.


โœฆ Lisensi

Dilisensikan di bawah MIT License.