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
| Fitur |
Deskripsi |
| 🔘 Interactive Messages |
buttons, lists, native flow, carousel |
| 🤖 AIRich Response |
rich message, table, code block formatting |
| 📰 Newsletter Support |
media upload, subscribe management |
| 🖼️ Album Messages |
group image/video albums |
| 📡 Group Status |
group & channel status support |
| 🏷️ Sticker Pack |
full sticker pack send support |
| 📊 Poll & Quiz |
poll, quiz, poll result messages |
| 💳 Payment Messages |
invoice, payment invite, request payment |
| 🕶️ Spoiler & Ephemeral |
wrap messages as spoiler or ephemeral |
| 🗄️ SQLite Auth State |
persistent 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
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' }) }
]
}
}
})
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' }] }
]
}]
}
}
})
await sock.sendMessage(jid, {
album: {
media: [
{ image: { url: 'https://...' }, caption: 'Foto 1' },
{ image: { url: 'https://...' }, caption: 'Foto 2' }
]
}
})
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