{"id":28714994,"url":"https://github.com/owensdev1/baileys-beta","last_synced_at":"2025-08-02T12:11:09.355Z","repository":{"id":297750389,"uuid":"997767489","full_name":"owensdev1/baileys-beta","owner":"owensdev1","description":"Lightweight full-featured typescript/javascript WhatsApp Web API","archived":false,"fork":false,"pushed_at":"2025-06-07T07:37:32.000Z","size":1673,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-07T08:25:13.494Z","etag":null,"topics":["baileys","baileys-api","baileys-bot","baileys-md","bot","mod","modification","whatsapp","whatsapp-api","whatsapp-bot"],"latest_commit_sha":null,"homepage":"https://hanlala.in/ows/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/owensdev1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-07T06:16:06.000Z","updated_at":"2025-06-07T07:47:15.000Z","dependencies_parsed_at":"2025-06-07T08:35:36.536Z","dependency_job_id":null,"html_url":"https://github.com/owensdev1/baileys-beta","commit_stats":null,"previous_names":["owensdev1/baileys-beta"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/owensdev1/baileys-beta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owensdev1%2Fbaileys-beta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owensdev1%2Fbaileys-beta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owensdev1%2Fbaileys-beta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owensdev1%2Fbaileys-beta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/owensdev1","download_url":"https://codeload.github.com/owensdev1/baileys-beta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/owensdev1%2Fbaileys-beta/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259910633,"owners_count":22930699,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["baileys","baileys-api","baileys-bot","baileys-md","bot","mod","modification","whatsapp","whatsapp-api","whatsapp-bot"],"created_at":"2025-06-15T02:00:46.950Z","updated_at":"2025-08-02T12:11:09.337Z","avatar_url":"https://github.com/owensdev1.png","language":"JavaScript","readme":"# 🚀 WhatsApp Web API\n\n\u003cdiv align=\"center\"\u003e\n\n![WhatsApp API Banner](https://camo.githubusercontent.com/8c1cc888a216088f8515ca5eb0dc7131bb190d6059af8d02c4616e39b6639114/68747470733a2f2f69696c692e696f2f325a706a746c702e6a7067)\n\n[![npm version](https://img.shields.io/npm/v/@owensdev1/baileys?style=for-the-badge\u0026color=00d26a)](https://www.npmjs.com/package/@owensdev1/baileys)\n[![Downloads](https://img.shields.io/npm/dm/@owensdev1/baileys?style=for-the-badge\u0026color=blue)](https://www.npmjs.com/package/@owensdev1/baileys)\n[![GitHub stars](https://img.shields.io/github/stars/owensdev1/baileys?style=for-the-badge\u0026color=yellow)](https://github.com/owensdev1/baileys/stargazers)\n[![License](https://img.shields.io/badge/License-GPL%20v3-red?style=for-the-badge)](https://www.gnu.org/licenses/gpl-3.0)\n\n**A powerful WebSockets-based TypeScript library for interacting with the WhatsApp Web API**\n\n[📖 Documentation](#-table-of-contents) • [🚀 Quick Start](#-quick-start) • [💬 Support](#-support) • [🤝 Contributing](#-contributing)\n\n\u003c/div\u003e\n\n---\n\n## ⚠️ Important Disclaimer\n\n\u003e [!WARNING]\n\u003e This project is **not affiliated** with WhatsApp Inc. Use responsibly and comply with WhatsApp's Terms of Service. \n\u003e \n\u003e **We strongly discourage:**\n\u003e - Spam messaging\n\u003e - Bulk messaging\n\u003e - Stalkerware usage\n\u003e - Any automated abuse\n\n---\n\n## ✨ Features\n\n\u003cdiv align=\"center\"\u003e\n\n| 🔐 **Multi-Device Support** | 📱 **QR \u0026 Pairing Code** | 🎨 **Rich Messages** | 🔄 **Real-time Events** |\n|:---:|:---:|:---:|:---:|\n| Connect as secondary device | Multiple connection methods | Buttons, polls, media, etc. | Live message updates |\n\n| 👥 **Group Management** | 🔒 **Privacy Controls** | 📊 **Message History** | 🎯 **Custom Functions** |\n|:---:|:---:|:---:|:---:|\n| Full admin capabilities | Block, privacy settings | Fetch chat history | Extensible architecture |\n\n\u003c/div\u003e\n\n---\n\n## 🚀 Quick Start\n\n### 📦 Installation\n\nChoose your preferred package manager:\n\n```bash\n# Using npm (stable version) **not available**\nnpm install @owensdev1/baileys\n\n# Using yarn (edge version)\nyarn add @owensdev1/baileys\n```\n\n### 🔌 Basic Usage\n\n```javascript\nconst { default: makeWASocket, DisconnectReason, useMultiFileAuthState } = require(\"@owensdev1/baileys\");\nconst { Boom } = require('@hapi/boom');\n\nasync function connectToWhatsApp() {\n    const { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys');\n    \n    const sock = makeWASocket({\n        auth: state,\n        printQRInTerminal: true\n    });\n\n    sock.ev.on('connection.update', (update) =\u003e {\n        const { connection, lastDisconnect } = update;\n        \n        if(connection === 'close') {\n            const shouldReconnect = (lastDisconnect.error as Boom)?.output?.statusCode !== DisconnectReason.loggedOut;\n            console.log('Connection closed, reconnecting...', shouldReconnect);\n            \n            if(shouldReconnect) {\n                connectToWhatsApp();\n            }\n        } else if(connection === 'open') {\n            console.log('✅ Connected to WhatsApp!');\n        }\n    });\n\n    sock.ev.on('messages.upsert', async (m) =\u003e {\n        console.log('📩 New message:', JSON.stringify(m, undefined, 2));\n        \n        // Echo received messages\n        const msg = m.messages[0];\n        if (!msg.key.fromMe \u0026\u0026 msg.message) {\n            await sock.sendMessage(msg.key.remoteJid, { text: 'Hello! 👋' });\n        }\n    });\n\n    sock.ev.on('creds.update', saveCreds);\n}\n\nconnectToWhatsApp();\n```\n\n---\n\n## 📚 Table of Contents\n\n\u003cdetails\u003e\n\u003csummary\u003e🔗 \u003cstrong\u003eClick to expand full contents\u003c/strong\u003e\u003c/summary\u003e\n\n### 🏗️ **Setup \u0026 Connection**\n- [🔌 Connecting Account](#connecting-account)\n  - [📱 QR Code Connection](#starting-socket-with-qr-code)\n  - [🔢 Pairing Code Connection](#starting-socket-with-pairing-code)\n  - [📜 Receive Full History](#receive-full-history)\n- [⚙️ Socket Configuration](#important-notes-about-socket-config)\n- [💾 Save Auth Info](#saving--restoring-sessions)\n\n### 📨 **Messaging**\n- [📤 Sending Messages](#sending-messages)\n  - [📝 Text Messages](#text-message)\n  - [🔘 Button Messages](#buttons-message)\n  - [🎯 Interactive Messages](#interactive-message)\n  - [📋 Poll Messages](#poll-message)\n  - [📍 Location Messages](#location-message)\n  - [👤 Contact Messages](#contact-message)\n- [🎬 Media Messages](#media-messages)\n- [✏️ Modify Messages](#modify-messages)\n\n### 👥 **Groups \u0026 Privacy**\n- [👥 Groups Management](#groups)\n- [🔒 Privacy Settings](#privacy)\n- [📢 Broadcast \u0026 Stories](#broadcast-lists--stories)\n\n### 🔧 **Advanced**\n- [📊 Data Store Implementation](#implementing-a-data-store)\n- [🎯 Custom Functionality](#writing-custom-functionality)\n- [🐛 Debug Mode](#enabling-debug-level-in-baileys-logs)\n\n\u003c/details\u003e\n\n---\n\n## 🔌 Connecting Account\n\n### 📱 Starting socket with **QR-CODE**\n\n\u003e [!TIP]\n\u003e Customize browser name using the `Browser` constant. See [available browsers](https://baileys.whiskeysockets.io/types/BrowsersMap.html).\n\n```javascript\nconst { default: makeWASocket, Browsers } = require(\"@owensdev1/baileys\");\n\nconst sock = makeWASocket({\n    browser: Browsers.ubuntu('My App'),\n    printQRInTerminal: true\n});\n```\n\n### 🔢 Starting socket with **Pairing Code**\n\n\u003e [!IMPORTANT]\n\u003e Pairing Code connects WhatsApp Web without QR-CODE. Phone number format: country code + number (no +, (), or -)\n\n```javascript\nconst sock = makeWASocket({\n    printQRInTerminal: false // Must be false for pairing code\n});\n\n// Standard pairing\nif (!sock.authState.creds.registered) {\n    const number = '1234567890'; // Your phone number\n    const code = await sock.requestPairingCode(number);\n    console.log('🔑 Pairing Code:', code);\n}\n\n// Custom pairing (8 digits/letters)\nif (!sock.authState.creds.registered) {\n    const customPair = \"12345678\";\n    const number = '1234567890';\n    const code = await sock.requestPairingCode(number, customPair);\n    console.log('🔑 Custom Pairing Code:', code);\n}\n```\n\n---\n\n## 💾 Saving \u0026 Restoring Sessions\n\nNever scan QR codes again! Save your session:\n\n```javascript\nconst { useMultiFileAuthState } = require(\"@owensdev1/baileys\");\n\nconst { state, saveCreds } = await useMultiFileAuthState('auth_info_baileys');\n\nconst sock = makeWASocket({ auth: state });\n\n// Auto-save credentials when they update\nsock.ev.on('creds.update', saveCreds);\n```\n\n\u003e [!WARNING]\n\u003e Always save auth keys when they update (`authState.keys.set()` is called) to ensure message delivery!\n\n---\n\n## 📤 Sending Messages\n\n### 📝 Text Message\n```javascript\nawait sock.sendMessage(jid, { text: 'Hello World! 🌍' });\n```\n\n### 🔘 Button Message\n```javascript\nawait sock.sendMessage(jid, {\n    text: \"Choose an option:\",\n    footer: \"© 2025 Your Bot\",\n    buttons: [\n        {\n            buttonId: 'btn1',\n            buttonText: { displayText: '✅ Option 1' },\n            type: 1\n        },\n        {\n            buttonId: 'btn2',\n            buttonText: { displayText: '❌ Option 2' },\n            type: 1\n        }\n    ],\n    headerType: 1\n});\n```\n\n### 🎯 Interactive Message with Flow\n```javascript\nawait sock.sendMessage(jid, {\n    text: \"Interactive Menu\",\n    footer: \"© 2025 Bot\",\n    buttons: [\n        {\n            buttonId: 'menu',\n            buttonText: { displayText: '📋 Show Menu' },\n            type: 4,\n            nativeFlowInfo: {\n                name: 'single_select',\n                paramsJson: JSON.stringify({\n                    title: 'Select Option',\n                    sections: [{\n                        title: 'Available Options',\n                        highlight_label: '⭐',\n                        rows: [\n                            {\n                                header: 'OPTION 1',\n                                title: 'First Choice',\n                                description: 'Description for option 1',\n                                id: 'opt1'\n                            },\n                            {\n                                header: 'OPTION 2', \n                                title: 'Second Choice',\n                                description: 'Description for option 2',\n                                id: 'opt2'\n                            }\n                        ]\n                    }]\n                })\n            }\n        }\n    ]\n});\n```\n\n### 📋 Poll Message\n```javascript\nawait sock.sendMessage(jid, {\n    poll: {\n        name: 'What\\'s your favorite color? 🎨',\n        values: ['🔴 Red', '🔵 Blue', '🟢 Green', '🟡 Yellow'],\n        selectableCount: 1\n    }\n});\n```\n\n### 🖼️ Image Message\n```javascript\nawait sock.sendMessage(jid, {\n    image: { url: './path/to/image.jpg' },\n    caption: 'Beautiful image! 📸'\n});\n```\n\n### 🎥 Video Message\n```javascript\nawait sock.sendMessage(jid, {\n    video: { url: './path/to/video.mp4' },\n    caption: 'Check this out! 🎬',\n    ptv: false // Set to true for video note\n});\n```\n\n### 🎵 Audio Message\n```javascript\nawait sock.sendMessage(jid, {\n    audio: { url: './path/to/audio.mp3' },\n    mimetype: 'audio/mp4'\n});\n```\n\n---\n\n## 📊 Implementing a Data Store\n\n\u003e [!IMPORTANT]\n\u003e Build your own data store for production. The in-memory store is just for testing!\n\n```javascript\nconst { makeInMemoryStore } = require(\"@owensdev1/baileys\");\n\nconst store = makeInMemoryStore({});\n\n// Load from file\nstore.readFromFile('./baileys_store.json');\n\n// Auto-save every 10 seconds\nsetInterval(() =\u003e {\n    store.writeToFile('./baileys_store.json');\n}, 10_000);\n\n// Bind to socket\nconst sock = makeWASocket({});\nstore.bind(sock.ev);\n\n// Access stored data\nsock.ev.on('chats.upsert', () =\u003e {\n    console.log('💬 Chats:', store.chats.all());\n});\n```\n\n---\n\n## 👥 Groups\n\n### 🆕 Create a Group\n```javascript\nconst group = await sock.groupCreate('🎉 My Awesome Group', [\n    '1234567890@s.whatsapp.net',\n    '0987654321@s.whatsapp.net'\n]);\n\nconsole.log('✅ Group created:', group.id);\nawait sock.sendMessage(group.id, { text: 'Welcome everyone! 👋' });\n```\n\n### 👤 Add/Remove Participants\n```javascript\nawait sock.groupParticipantsUpdate(\n    groupJid,\n    ['1234567890@s.whatsapp.net'],\n    'add' // 'remove', 'promote', 'demote'\n);\n```\n\n### ⚙️ Change Group Settings\n```javascript\n// Update group name\nawait sock.groupUpdateSubject(groupJid, '🚀 New Group Name');\n\n// Update description\nawait sock.groupUpdateDescription(groupJid, '📝 New group description');\n\n// Admin-only messages\nawait sock.groupSettingUpdate(groupJid, 'announcement');\n\n// Everyone can send messages\nawait sock.groupSettingUpdate(groupJid, 'not_announcement');\n```\n\n---\n\n## 🔒 Privacy\n\n### 🚫 Block/Unblock Users\n```javascript\n// Block user\nawait sock.updateBlockStatus(jid, 'block');\n\n// Unblock user  \nawait sock.updateBlockStatus(jid, 'unblock');\n```\n\n### ⚙️ Privacy Settings\n```javascript\n// Update various privacy settings\nawait sock.updateLastSeenPrivacy('contacts'); // 'all', 'contacts', 'none'\nawait sock.updateOnlinePrivacy('all'); // 'all', 'match_last_seen'\nawait sock.updateProfilePicturePrivacy('contacts');\nawait sock.updateStatusPrivacy('contacts');\nawait sock.updateReadReceiptsPrivacy('all'); // 'all', 'none'\n```\n\n---\n\n## 🐛 Debugging\n\nEnable debug mode to see all WhatsApp communications:\n\n```javascript\nconst sock = makeWASocket({\n    logger: P({ level: 'debug' }),\n});\n```\n\n### 🎯 Custom Event Handlers\n```javascript\n// Listen for specific WebSocket events\nsock.ws.on('CB:edge_routing', (node) =\u003e {\n    console.log('📡 Edge routing message:', node);\n});\n\n// Listen with specific attributes\nsock.ws.on('CB:edge_routing,id:abcd', (node) =\u003e {\n    console.log('🎯 Specific edge routing message:', node);\n});\n```\n\n---\n\n## 💬 Support\n\n\u003cdiv align=\"center\"\u003e\n\n### 🆘 Need Help?\n\n| 📞 **Contact** | 💬 **WhatsApp** | 📧 **Issues** |\n|:---:|:---:|:---:|\n| **6285358977442** | For Baileys support | [GitHub Issues](https://github.com/owensdev1/baileys/issues) |\n\n\u003c/div\u003e\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how you can help:\n\n1. 🍴 Fork the repository\n2. 🌟 Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. 💻 Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. 📤 Push to the branch (`git push origin feature/AmazingFeature`)\n5. 🔄 Open a Pull Request\n\n---\n\n## 📄 License\n\nThis project is licensed under the **GPL v3 License** - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🙏 Acknowledgments\n\n- Built with ❤️ using [libsignal-node](https://git.questbook.io/backend/service-coderunner/-/merge_requests/1)\n- Special thanks to the WhatsApp Web reverse engineering community\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n### ⭐ Star this repo if it helped you!\n\n[![GitHub stars](https://img.shields.io/github/stars/owensdev1/baileys?style=social)](https://github.com/owensdev1/baileys/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/owensdev1/baileys?style=social)](https://github.com/owensdev1/baileys/network)\n\n**Made with 💻 and ☕ by the community**\n\n\u003c/div\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowensdev1%2Fbaileys-beta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fowensdev1%2Fbaileys-beta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fowensdev1%2Fbaileys-beta/lists"}