open-wa/wa-automate-docker

Is it possible to capture QR code and save as image? #5

manojsitapara posted onGitHub

Thank you for making this wonderful library.

I would like to display QR code to my web browser, but currently it generate and display on console screen.

is it possible to export QR code as image or export as base64 to display on web browser?

Thank you !!


@manojsitapara thanks for your kind words.

It is possible to get the qr code via a URL but it depends on how exactly you're using this system.

It can be as simple as adding

      WA_POPUP: 'true'
      WA_POPUP_QR_ONLY: 'true'

to the bottom of https://github.com/open-wa/wa-automate-docker/blob/master/docker-compose.yaml

which should serve the QR code on :3000/qr

OR

you can change package.json so that

https://github.com/open-wa/wa-automate-docker/blob/4ac954128eea39c7194fd274fe27f85b71aeb8c0/package.json#L7

becomes

    "start": "npx @open-wa/wa-automate --in-docker -p 8080 --popup --popup-qr-only --npm-options=--ignore-scripts",

then rebuild and run,

which should show the qr code on :8080/qr

Try these out and let me know if something is not working.

Thanks

posted by smashah about 4 years ago

@smashah Thank you for your quick & prompt reply. I like your first solution.

I have tried first solution, added code at suggested at bottom of file.

WA_POPUP: 'true' WA_POPUP_QR_ONLY: 'true'

it giving me following error on this URL http://localhost:3000/qr

Cannot GET /qr

Cannot POST /qr

Do I need to do anything extra?

posted by manojsitapara about 4 years ago

@manojsitapara let me have a look at it and I'll get back to you

posted by smashah about 4 years ago

@manojsitapara should be working in latest image

posted by smashah over 3 years ago

Fund this Issue

$0.00
Funded

Pull requests