npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

whatsapp.js-qrcode-page

v0.0.2

Published

This library is a utility for WhatsAppWeb.js that simplifies the process of displaying the WhatsApp QR code on web pages. It provides a straightforward and easy-to-integrate solution for web developers looking to connect their applications with WhatsApp u

Downloads

3

Readme

WhatsappJS QRCode Page

This library is a utility for WhatsAppWeb.js that simplifies the process of displaying the WhatsApp QR code on web pages. It provides a straightforward and easy-to-integrate solution for web developers looking to connect their applications with WhatsApp using the WhatsAppWeb.js library.

Usage

When a Client instance is initialized using whatsapp-web.js, the library will register a route for each client. You can access the QR code for each client by navigating to the appropriate route as described above. This functionality facilitates easy management and access to multiple WhatsApp sessions from a single server.

Endpoints

  • Default QR Code:

    • Path: /generate-qr
    • Description: If no specific WhatsApp number is provided, this route will display the QR code for the default initialized client.
  • Generate QR Code:

    • Path: /generate-qr/${whatsappNumber}
    • Description: Generates and displays the QR code for the specified WhatsApp number. Replace ${whatsappNumber} with the actual WhatsApp number associated with a client.
    • Example: Accessing /generate-qr/1234567890 will display the QR code for the WhatsApp number 1234567890.
  • List Registered Routes:

    • Path: /
    • Description: This route lists all the registered QR code routes available for different initialized clients.

Example

const { Client } = require("whatsapp-web.js");
const {
  runQRCodeServer,
  registerQRCodeRoute,
} = require("whatsappjs-qr-code-view");

function run() {
  const client = new Client();

  client.once("ready", () => {
    console.log("Client is ready!");
  });

  // will register a route for qrcode image when 'qr' event is fired
  registerQRCodeRoute(client);

  client.initialize();

  // will initialize qrcode image server
  runQRCodeServer();
}

run();

Accessing the QR Code Page

When accessing the QR code display pages, you will be prompted to enter the credentials. Use the values set for QR_CODE_SERVER_USER and QR_CODE_SERVER_PASSWORD. If you have changed the port, make sure to access the server using the new QR_CODE_SERVER_PORT.

Security

The QR code display pages are protected with basic authentication to ensure secure access. Enter the credentials when prompted to secure your QR code access.

Configuration

To customize the settings of the QR code server, you can use the following environment variables:

Environment Variables

  • QR_CODE_SERVER_USER: Username for the QR code server authentication. Default is "admin".
  • QR_CODE_SERVER_PASSWORD: Password for the QR code server authentication. Default is "admin".
  • QR_CODE_SERVER_PORT: Port on which the QR code server runs. Default is 3000.

Support

For support, email [email protected] or open an issue in the GitHub repository.