pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
14.62k stars 3.48k forks source link

How to build for production and install on web server for personal use #533

Closed inglesuniversal closed 3 years ago

inglesuniversal commented 3 years ago

I tried NPM run build and no luck

How can I export a working project which I can access on the web without the need of a Chromium browser?

Thanks

PurpShell commented 3 years ago

you make no sense... You have to create your own back-end, and then just copy source code, add a package.json with all the dependencies

ameybh commented 3 years ago

@inglesuniversal See https://github.com/ameybhavsar24/ww-bot. I tried doing this few months back. I have added instructions to host it as a worker on Heroku. See DEPLOY.md.

How can I export a working project which I can access on the web without the need of a Chromium browser?

You cannot remove the chromium installation since that is how the whatsapp-web.js library interacts with Whatsapp Web.

PurpShell commented 3 years ago

@ameybhavsar24 you can use a buildpack for puppeteer

pedroslopez commented 3 years ago

Like others have said, you can deploy it to Heroku by following the steps outlined by @ameybhavsar24 . The Chromium browser is needed to be able to talk to the WhatsApp Web application. Because of this, the library needs to run on a server, in the backend, and you can write an API using something like Express.js to be able to call it remotely.

inglesuniversal commented 3 years ago

Thanks for your suggestions... If I knew more about node.js I would not waste your valuable time asking simple questions like these. I'll pick up on it!