{"id":14987013,"url":"https://github.com/briuor/wbm","last_synced_at":"2025-04-05T13:05:01.917Z","repository":{"id":42179860,"uuid":"238569165","full_name":"Briuor/wbm","owner":"Briuor","description":"wbm is an unofficial API to send bulk messages in whatsapp.","archived":false,"fork":false,"pushed_at":"2022-03-26T03:43:04.000Z","size":190,"stargazers_count":208,"open_issues_count":23,"forks_count":66,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-05T13:04:39.316Z","etag":null,"topics":["bulk-messages","bulk-messages-api","message-sender","phone-number","send-message","send-message-api","send-messages-api","wbm","whatsapp","whatsapp-api","whatsapp-bulk-message","whatsapp-bulk-messages","whatsapp-bulk-sender","whatsapp-library","whatsapp-message-sender","whatsapp-messages","whatsapp-sender","whatsapp-web"],"latest_commit_sha":null,"homepage":"","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/Briuor.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}},"created_at":"2020-02-05T23:28:11.000Z","updated_at":"2025-03-29T22:18:34.000Z","dependencies_parsed_at":"2022-09-05T01:01:01.012Z","dependency_job_id":null,"html_url":"https://github.com/Briuor/wbm","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Briuor%2Fwbm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Briuor%2Fwbm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Briuor%2Fwbm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Briuor%2Fwbm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Briuor","download_url":"https://codeload.github.com/Briuor/wbm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339155,"owners_count":20923014,"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":["bulk-messages","bulk-messages-api","message-sender","phone-number","send-message","send-message-api","send-messages-api","wbm","whatsapp","whatsapp-api","whatsapp-bulk-message","whatsapp-bulk-messages","whatsapp-bulk-sender","whatsapp-library","whatsapp-message-sender","whatsapp-messages","whatsapp-sender","whatsapp-web"],"created_at":"2024-09-24T14:13:57.164Z","updated_at":"2025-04-05T13:05:01.868Z","avatar_url":"https://github.com/Briuor.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://img.shields.io/npm/v/wbm.svg?color=%2378e08f)](https://www.npmjs.com/package/wbm)\n\n# wbm\n\u003e wbm is an **unofficial** API to send bulk messages in whatsapp.\n\n\u003cp align=\"center\"\u003e \n\u003cimg style=\"border-radius: 5px\" src=\"https://raw.githubusercontent.com/Briuor/wbm/master/assets/demo.gif\"\u003e\n\u003c/p\u003e\n\n## Note\n**wbm** is an **unofficial** solution. It's not recommended using **wbm** in your company or for marketing purpose.\n\n## Installation\n```bash\n\u003e npm install wbm\n```\n\n## Usage\n**At the beginning it will display a QR Code on terminal, just scan it using whatsapp app.\u003cbr /\u003e\nYour session will be remembered, there is no need to authenticate everytime.**\n\n### Send same message to every contact\n\n```javascript\nconst wbm = require('wbm');\n\nwbm.start().then(async () =\u003e {\n    const phones = ['5535988841854', '35988841854', '5535988841854'];\n    const message = 'Good Morning.';\n    await wbm.send(phones, message);\n    await wbm.end();\n}).catch(err =\u003e console.log(err));\n\n```\n### Send custom message to every contact\n\n```javascript\nconst wbm = require('wbm');\n\nwbm.start().then(async () =\u003e {\n    const contacts = [\n        { phone: '5535988841854', name: 'Bruno', age: 21 },\n        { phone: '5535988841854', name: 'Will', age: 33 }\n    ];\n    const message = 'Hi {{name}}, your age is {{age}}';\n    // Hi Bruno, your age is 21\n    // Hi Will, your age is 33\n    await wbm.send(contacts, message);\n    await wbm.end();\n}).catch(err =\u003e console.log(err));\n```\n\n### Send custom messages using YOUR OWN RULE\n\n```javascript\nconst wbm = require('wbm');\n\nwbm.start().then(async () =\u003e {\n    const contacts = [\n        { phone: '5535988841854', name: 'Bruno', group: 'friend' }, \n        { phone: '5535988841854', name: 'Will', group: 'customer' }\n    ];\n    for (contact of contacts) {\n        let message = 'hi';\n        if(contact.group === 'customer') {\n            message = 'Good morning ' + contact.name;\n        }\n        else if(contact.group === 'friend') {\n            message = 'Hey ' + contact.name + '. Wassup?';\n        }\n        await wbm.sendTo(contact.phone, message);\n    }\n    await wbm.end();\n}).catch(err =\u003e console.log(err));\n\n```\n\n## API\n### start(options)\n* **options**\u003cbr /\u003e\n\tObject containing optional parameters as attribute.\u003cbr /\u003e\n\tType: `object`\u003cbr /\u003e\n\t* **showBrowser**\u003cbr /\u003e\n\tShow browser running the script.\u003cbr /\u003e\n\tDefault: `false`\u003cbr /\u003e\n\tType: `boolean`\u003cbr /\u003e\n\t* **qrCodeData**\u003cbr /\u003e\n\tInstead of generate the QR Code, returns the data used to generate the QR Code as promise.\u003cbr /\u003e\n\tDefault: `false`\u003cbr /\u003e\n\tType: `boolean`\u003cbr /\u003e\n\t* **session**\u003cbr /\u003e\n\tKeep user session, so the user must scan the QR Code once.\u003cbr /\u003e\n    If you already is authenticated and **wbm** is asking for QR Code, please run using **session: false** once to reset your session. Then you use **session: true** again.\u003cbr /\u003e\n\tDefault: `true`\u003cbr /\u003e\n\tType: `boolean`\n\n```javascript\n// It will open a browser, return the QR code data as promise and not keep user session\nwbm.start({showBrowser: true, qrCodeData: true, session: false})\n.then(async qrCodeData =\u003e {\n    console.log(qrCodeData); // show data used to generate QR Code\n    await wbm.waitQRCode();\n    // waitQRCode() is necessary when qrCodeData is true\n    // ...\n    await wbm.end();\n} ).catch(err =\u003e { console.log(err); });\n```\n\n### send(phoneOrContacts, message)\n\nSend message to every phone number.\n\n- **phoneOrContacts**\u003cbr /\u003e\nArray of phone numbers: ['5535988841854', ...].\u003cbr /\u003e\nOr \u003cbr /\u003e\nArray of contacts: [{phone: '5535988841854', name: 'Will', group: 'partner', age: 22', any: 'anything', ...}, ...]\u003cbr /\u003e\nType: `array`\n\n- **message**\u003cbr /\u003e\nMessage to send to every phone number.\u003cbr /\u003e\nText inside curly braces like {{attribute}} will be replaced by the contact object respective attribute.\u003cbr /\u003e\nType: `string`\n\n```javascript\nwbm.start().then(async () =\u003e {\n    const contacts = [\n        {phone: '5535988841854', name: 'Bruno'},\n        {phone: '5535988841854', name: 'Will'}\n    ];\n    await wbm.send(contacts, 'Hey {{name}}');\n    // Hey Bruno\n    // Hey Will\n    await wbm.send(['5535988841854', '5535988841854'], 'Hey man'); \n    // Hey man\n    // Hey man\n    await wbm.end();\n}).catch(err =\u003e { console.log(err); });\n```\n\n### sendTo(phoneOrContact, message)\n\nSend message to a single phone number.\n\n- **phoneOrContact**\u003cbr /\u003e\nPhone number. Example '5535988841854'.\u003cbr /\u003e\nType: `string`\u003cbr /\u003e\nOr\nContact object. Example: {phone: '5535988841854', name: 'Will', group: 'partner'}\u003cbr /\u003e\nType: `object`\n\n- **message**\u003cbr /\u003e\nMessage to send to phone number.\u003cbr /\u003e\nText inside curly braces like {{attribute}} will be replaced by the contact object respective attribute.\u003cbr /\u003e\nType: `string`\n\n```javascript\nwbm.start().then(async () =\u003e {\n    await wbm.sendTo({phone: '5535988841854', name: 'Bruno'}, 'Hey {{name}}');\n    // Hey Bruno\n    await wbm.sendTo('5535988841854', 'Hey man');\n    // Hey man\n    await wbm.end();\n}).catch(err =\u003e { console.log(err); });\n```\n\n### end()\nThis method must be used at the end of wbm.start() to finish the browser.\n\n## Contributing\n\nFeel free to create pull requests. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriuor%2Fwbm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbriuor%2Fwbm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbriuor%2Fwbm/lists"}