New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@jexkcode/baileys

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jexkcode/baileys

JexkCode Baileys - Enhanced WhatsApp Web API with interactive messages, albums, newsletter support, and AIRich responses.

latest
Source
npmnpm
Version
1.3.0
Version published
Maintainers
1
Created
Source

Enhanced WhatsApp Web API — forked and customized by jexkpinkman

buttons · lists · polls · albums · newsletters · payments · sqlite auth


📋 Table of Contents

  • Features
  • Install
  • Quick Start
  • Message Examples
  • Auth State Options
  • License

✨ Features

FiturDeskripsi
🔘 Interactive Messagesbuttons, lists, native flow, carousel
🤖 AIRich Responserich message, table, code block formatting
📰 Newsletter Supportmedia upload, subscribe management
🖼️ Album Messagesgroup image/video albums
📡 Group Statusgroup & channel status support
🏷️ Sticker Packfull sticker pack send support
📊 Poll & Quizpoll, quiz, poll result messages
💳 Payment Messagesinvoice, payment invite, request payment
🕶️ Spoiler & Ephemeralwrap messages as spoiler or ephemeral
🗄️ SQLite Auth Statepersistent auth with SQLite

🆕 v1.3.0 — fitur tambahan (port dari JAPofc/baileys, MIT)

// Mini App: kartu + tombol buka web (bisa dengan link bertanda-tangan HMAC) / WhatsApp Flow
await sock.sendMiniApp(jid, { title: 'App', body: 'Buka 👇', url: 'https://app.example', params: { ref: 'bot' },
  secret: 'rahasia', expiresIn: 3600, openWebview: true })
// verifikasi di server web kamu:  verifyMiniAppRequest(req.query, { secret })

// A2UI widget
const ui = new A2UI(); ui.root([ui.text('Halo', { variant: 'h1' }), ui.button(ui.text('Klik'))])
await sock.sendA2UIWidget(jid, { a2ui: ui, bodyText: 'tes' })

// Transkripsi voice note (Whisper-compatible)
const { text } = await sock.transcribeMessage(m, { provider: openAIWhisperProvider({ apiKey }) })

// Tombol nativeFlow baru: { webview }, { reminder }, { cancelReminder }, { address }, { location: true },
// { catalog }, { products }, { flow }, { voiceCall }, { videoCall }, { clearChat }, { screen }

await sock.sendScheduledCall(jid, { scheduledAt: Date.now() + 3600e3, callType: 'voice', title: 'Rapat' })
await sock.sendMentionAll(jid, 'Halo semua')
await sock.sendStatusMention({ text: 'hi' }, [jid1, jid2])

// Username (baca-saja): checkUsername, checkUsernameMulti, getMyUsername, getUsernameRecommendations,
// findUserByUsername, fetchContactUsernames — pakai query_id yang bisa kedaluwarsa (lihat sock.setUsernameQueryIds)

// Util: autoReconnect, createMockSocket, exportChatAsCSV / exportChatAsText / exportChatAsJSON, chatStatistics

📦 Install

npm install github:jexkpinkman/JexkCode-baileys

🚀 Quick Start

import makeWASocket, { useMultiFileAuthState, DisconnectReason } from 'jexkcode'
import { Boom } from '@hapi/boom'

const { state, saveCreds } = await useMultiFileAuthState('auth_info')

const sock = makeWASocket({ auth: state })

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

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

💬 Message Examples

🔘 Interactive Button
await sock.sendMessage(jid, {
  interactive: {
    body: { text: 'Pilih menu:' },
    footer: { text: 'JexkCode Bot' },
    header: { hasMediaAttachment: false },
    nativeFlowMessage: {
      buttons: [
        { name: 'quick_reply', buttonParamsJson: JSON.stringify({ display_text: 'Menu', id: 'menu' }) },
        { name: 'quick_reply', buttonParamsJson: JSON.stringify({ display_text: 'Help', id: 'help' }) }
      ]
    }
  }
})
🤖 AIRich Response (Table)
await sock.sendMessage(jid, {
  aiRich: {
    message: { conversation: 'Data pengguna:' },
    unifiedResponse: {
      components: [{
        type: 'table',
        columns: [{ name: 'Nama' }, { name: 'Status' }],
        rows: [
          { cells: [{ content: 'User A' }, { content: 'Aktif' }] },
          { cells: [{ content: 'User B' }, { content: 'Tidak Aktif' }] }
        ]
      }]
    }
  }
})
🖼️ Album Message
await sock.sendMessage(jid, {
  album: {
    media: [
      { image: { url: 'https://...' }, caption: 'Foto 1' },
      { image: { url: 'https://...' }, caption: 'Foto 2' }
    ]
  }
})
📊 Poll
await sock.sendMessage(jid, {
  poll: {
    name: 'Pilih warna favoritmu!',
    values: ['Merah', 'Hijau', 'Biru'],
    selectableCount: 1
  }
})

🔐 Auth State Options

// Multi-file (default)
import { useMultiFileAuthState } from 'jexkcode'
const { state, saveCreds } = await useMultiFileAuthState('./auth_info')

// Single file
import { useSingleFileAuthState } from 'jexkcode'
const { state, saveCreds } = await useSingleFileAuthState('./auth.json')

// SQLite
import { useSQLiteAuthState } from 'jexkcode'
const { state, saveCreds } = await useSQLiteAuthState('./auth.db')

📄 License

MIT License © 2026 jexkpinkman


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Created by jexkpinkman

Keywords

automation

FAQs

Package last updated on 25 Oct 2026

Related posts