-

npm

+

npm Depfu

whatsapp-web.js

A WhatsApp API client that connects through the WhatsApp Web browser app

It uses Puppeteer to run a real instance of Whatsapp Web to avoid getting blocked.

NOTE: I can't guarantee you will not be blocked by using this method, although it has worked for me. WhatsApp does not allow bots or unofficial clients on their platform, so this shouldn't be considered totally safe.

-

This is still very much a work in progress, but you can check out example.js to see how to read and send messages.

Installation

The module is now available on npm! npm i whatsapp-web.js

+

Please note that Node v8+ is required due to Puppeteer.

+

Example usage

+
const { Client } = require('whatsapp-web.js');
+const client = new Client();
+
+client.on('qr', (qr) => {
+    // Generate and scan this code with your phone
+    console.log('QR RECEIVED', qr);
+});
+
+client.on('ready', () => {
+    console.log('Client is ready!');
+});
+
+client.on('message', msg => {
+    if (msg.body == '!ping') {
+        msg.reply('pong');
+    }
+});
+
+client.initialize();
+
+

Take a look at example.js for another example with more use cases.

+

Supported features

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureStatus
Send messages
Receive messages
Send media (images/audio/documents)
Send media (video)pending
Send stickerspending
Receive media (images/audio/video/documents)
Send contact cardspending
Send locationpending
Message replies
Join groups by invite
Modify group info (subject, description)
Add group participants
Kick group participants
Promote/demote group participants
Mention userspending
Get contact info
+

Something missing? Make an issue and let us know!

+

Links

+ +

Contributing

+

Pull requests are welcome! If you see something you'd like to add, please do. For drastic changes, please open an issue first.

diff --git a/docs/structures_Base.js.html b/docs/structures_Base.js.html index 1285182..6deb428 100644 --- a/docs/structures_Base.js.html +++ b/docs/structures_Base.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/Base.js + whatsapp-web.js 0.3.2-post » Source: structures/Base.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_BusinessContact.js.html b/docs/structures_BusinessContact.js.html index e01c6c8..5b8f553 100644 --- a/docs/structures_BusinessContact.js.html +++ b/docs/structures_BusinessContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/BusinessContact.js + whatsapp-web.js 0.3.2-post » Source: structures/BusinessContact.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_Chat.js.html b/docs/structures_Chat.js.html index 2be6386..dbf73cd 100644 --- a/docs/structures_Chat.js.html +++ b/docs/structures_Chat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/Chat.js + whatsapp-web.js 0.3.2-post » Source: structures/Chat.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_ClientInfo.js.html b/docs/structures_ClientInfo.js.html index 26eac65..fcf1bfa 100644 --- a/docs/structures_ClientInfo.js.html +++ b/docs/structures_ClientInfo.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/ClientInfo.js + whatsapp-web.js 0.3.2-post » Source: structures/ClientInfo.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_Contact.js.html b/docs/structures_Contact.js.html index 19d9880..c64deab 100644 --- a/docs/structures_Contact.js.html +++ b/docs/structures_Contact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/Contact.js + whatsapp-web.js 0.3.2-post » Source: structures/Contact.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_GroupChat.js.html b/docs/structures_GroupChat.js.html index 891c505..0dad25f 100644 --- a/docs/structures_GroupChat.js.html +++ b/docs/structures_GroupChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/GroupChat.js + whatsapp-web.js 0.3.2-post » Source: structures/GroupChat.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_Message.js.html b/docs/structures_Message.js.html index 8a83166..5889929 100644 --- a/docs/structures_Message.js.html +++ b/docs/structures_Message.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/Message.js + whatsapp-web.js 0.3.2-post » Source: structures/Message.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_MessageMedia.js.html b/docs/structures_MessageMedia.js.html index 3b5b287..691f4ed 100644 --- a/docs/structures_MessageMedia.js.html +++ b/docs/structures_MessageMedia.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/MessageMedia.js + whatsapp-web.js 0.3.2-post » Source: structures/MessageMedia.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_PrivateChat.js.html b/docs/structures_PrivateChat.js.html index 2426377..d557dd6 100644 --- a/docs/structures_PrivateChat.js.html +++ b/docs/structures_PrivateChat.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/PrivateChat.js + whatsapp-web.js 0.3.2-post » Source: structures/PrivateChat.js @@ -15,7 +15,7 @@ diff --git a/docs/structures_PrivateContact.js.html b/docs/structures_PrivateContact.js.html index a51db2b..0c6a657 100644 --- a/docs/structures_PrivateContact.js.html +++ b/docs/structures_PrivateContact.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: structures/PrivateContact.js + whatsapp-web.js 0.3.2-post » Source: structures/PrivateContact.js @@ -15,7 +15,7 @@ diff --git a/docs/util_Constants.js.html b/docs/util_Constants.js.html index 49adda6..499b7f2 100644 --- a/docs/util_Constants.js.html +++ b/docs/util_Constants.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: util/Constants.js + whatsapp-web.js 0.3.2-post » Source: util/Constants.js @@ -15,7 +15,7 @@ diff --git a/docs/util_Util.js.html b/docs/util_Util.js.html index 346d35d..7a5555d 100644 --- a/docs/util_Util.js.html +++ b/docs/util_Util.js.html @@ -4,7 +4,7 @@ - whatsapp-web.js 0.3.2 » Source: util/Util.js + whatsapp-web.js 0.3.2-post » Source: util/Util.js @@ -15,7 +15,7 @@