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

wa-automate

v1.0.0

Published

💬 🤖 The most reliable NodeJS whatsapp library for chatbots with advanced features.

Downloads

10

Readme

[!WARNING]
By visiting this page you explicitly agree to the Terms of Service (read here)

wa-automate-nodejs

wa-automate-nodejs is the most advanced NodeJS library which provides a high-level API to control WA.

Ceasefire Now

npm version node Downloads Average time to resolve an issue Percentage of issues still open

WhatsApp_Web 2.2147.16

Installation and Updating

Use this command to install the library for the first time and to keep the library up to date.

> npm i --save @open-wa/wa-automate@latest

Usage

CLI

Want to convert your WA account to an API instantly? You can now with the CLI. For more details see Easy API

> npx @open-wa/wa-automate --help

Custom Setup

Learn more about all possible configuration options here: ConfigObject

const wa = require('@open-wa/wa-automate');

wa.create({
  sessionId: "COVID_HELPER",
  multiDevice: true, //required to enable multiDevice support
  authTimeout: 60, //wait only 60 seconds to get a connection with the host account device
  blockCrashLogs: true,
  disableSpins: true,
  headless: true,
  hostNotificationLang: 'PT_BR',
  logConsole: false,
  popup: true,
  qrTimeout: 0, //0 means it will wait forever for you to scan the qr code
}).then(client => start(client));

function start(client) {
  client.onMessage(async message => {
    if (message.body === 'Hi') {
      await client.sendText(message.from, '👋 Hello!');
    }
  });
}
After executing create() function, @open-wa/wa-automate will create an instance of WA web. If you are not logged in, it will print a QR code in the terminal. Scan it with your phone and you are ready to go!
@open-wa/wa-automate will remember the session so there is no need to authenticate every time

Multi Device Support

We're currently in a weird transitionary period where some people are being forced to adopt Multi Device (MD). Once the transition is complete, the library default will be to turn on MD support. For now, you have to set it yourself explicitly either by using the --multi-device flag (with the CLI) or setting multiDevice: true in your config (with your custom code)

Latest Changes

With the constant updates from WA. It is advisable to always use the latest version of @open-wa/wa-automate.

Functions list

| Function | Reference | | --------------------------------- | ----------- | | Receive message | onMessage | Automatic QR Refresh | autoRefresh | Send text | sendText | Get contacts | getContact | Get chats | getAllChats | Get groups | getAllGroups | Get group members | getGroupMembersId | Send contact | sendContact | Send Images (image) | sendImage | Send media (audio, doc) | sendFile | Send media (video) | Send Videos | Send stickers | sendStickerfromUrl | Decrypt media (image, audio, doc) | Decrypt Media | Capturing QR Code | Capturing QR Code | Multiple Sessions | Multiple Sessions | Last seen | getLastSeen | isOnline | isChatOnline | 📍 Send Location | sendLocation | Simulated '...typing' | simulateTyping | Send GIFs! | sendVideoAsGif | Send Giphy! | sendGiphy | Forward Messages | forwardMessages | Listen to Read Receipts | onAck | Listen to Live Locations | onLiveLocation | Group participant changes | onParticipantsChanged | Create Groups | Create Group | add, remove, promote, demote participants | Manage Participants

Checkout all the available functions here.

Running the demo

You can clone this repo and run the demo, but you will need to use typescript/ts-node:

> git clone https://github.com/open-wa/wa-automate-nodejs.git
> cd wa-automate-nodejs
> npm i
> npm i -g ts-node typescript
> cd demo
> ts-node index.ts

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Support

If you need paid support, consulting, or just want support/sponsor the ongoing development of this project, you can in the following ways:

|Description | Link | |- |:-:| | Get a License key | Get a License key | Donate or Book 1 hour consult | Buy me a coffee | Per-minute consulting | | Hire me! | Consulting Request

License

Hippocratic + Do Not Harm Version 1.0

Legal

This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by WA or any of its affiliates or subsidiaries. This is an independent and unofficial software. Use at your own risk.

Cryptography Notice

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.