Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jeast-whatsapp-api

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jeast-whatsapp-api

Useful tools for whatsapp

  • 1.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

Jeast Whatsapp

npm license stars stars

Jeast Whatsapp API

A Simple whatsapp api that connects through the whatsapp web, that is used for all needs such as sending messages, and authenticating on whatsapp via qr code.

🚀 Installation

Type the npm command below to install the package

npm i jeast-whatsapp-api

Please note that Node v12+ is required.

⭕ Basic usage

const Jeast = require("jeast-whatsapp-api");

const client = new Jeast();

client.on("qr_code", async (qr) => {
  if (qr) {
    console.log(qr);
  }
});

client.on("connection", async (connection) => {
  if (connection.isConnected) {
    console.log("connected!");
  }
});

client.on("message", async (message) => {
  if (message.body == "Hello") {
    await client.sendMessage(message.id.remote, 'Hai')
  }
});

client.connect({
  logger: true,
  qr_terminal: true,
  authState: {
    isAuth: true,
    authType: "multidevice",
    authId: "example_account",
  },
});

🖼 Send as Sticker

const { Jeast, MsgMedia } = require("jeast-whatsapp-api");

const client = new Jeast()

const sticker = MsgMedia.fromFilePath(
  __dirname + "/path/to/file"
);
await client.sendMessage(message.id.remote, sticker, {
  sendAsSticker: true,
});

🖻 Send as Document

const { Jeast, MsgMedia } = require("jeast-whatsapp-api");

const client = new Jeast()

const document = MsgMedia.fromFilePath(
  __dirname + "/path/to/file"
);
await client.sendMessage(message.id.remote, document, {
  sendAsDocument: true,
});

👾 Send Video as Gif

const { Jeast, MsgMedia } = require("jeast-whatsapp-api");

const client = new Jeast()

const video = MsgMedia.fromFilePath(__dirname + "/path/to/file");
await client.sendMessage(message.id.remote, video, {
  sendVideoAsGif: true,
});

client.connect({
  logger: true,
  executablePath: "/path/to/chrome", //use executablePath to send video or gif
  qr_terminal: true,
  authState: {
    isAuth: true,
    authType: "multidevice",
    authId: "example_account",
  },
});

📑 License

MIT License

Copyright (c) 2022 Ferdian Satria Akbar

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

Keywords

FAQs

Package last updated on 03 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc