An open API service indexing awesome lists of open source software.

https://github.com/hyperjumptech/whatsapp-business-sender

Node.js library for sending message through Whatsapp Business API
https://github.com/hyperjumptech/whatsapp-business-sender

nodejs typescript whatsapp

Last synced: about 1 year ago
JSON representation

Node.js library for sending message through Whatsapp Business API

Awesome Lists containing this project

README

          

# **Whatsapp Business Sender**

Whatsapp Business Sender is the library for sending whatsapp for business message api using node js.

## **Built With**

- [Nodejs](https://nodejs.org/en/)
- [Axios](https://github.com/axios/axios)
- [Typescript](https://www.typescriptlang.org)

## **Getting Started**

### Prerequisites

- Node.js v^14.14.37
- npm v6.14.11

### Installing

```bash
npm install @hyperjumptech/whatsapp-business-sender
```

## **Libraries**

### Exposed Libraries

```
- loginUser
- checkContacts
- sendMessageTemplateText
```

### Descriptions

**_loginUser_**

The method to run login-user endpoint in the Whatsapp Business API :

- baseURL : Whatsapp business api server host
- creds : Whatsapp business user credentials, consist of username and password

_usage:_

```js
import whatsapp from "@hyperjumptech/whatsapp-business-sender";

const resp = await whatsapp.loginUser("", {
username: "",
password: "",
});
```

**_checkContacts_**

The method to run check-contacts endpoint in the Whatsapp Business API :

- baseURL : Whatsapp business api server host
- token : token from the user login
- phones : string arrays of phone number using country code

_usage:_

```js
import whatsapp from "@hyperjumptech/whatsapp-business-sender";

const resp = await whatsapp.checkContacts("", "", [
"",
"",
"",
]);
```

**_sendMessageTemplateText_**

The method to run send-message-template-text endpoint in Whatsapp Business API :

- baseURL : Whatsapp business api server host
- token : token from the user login
- data : consist of phone number and template configurations

_usage:_

```js
import whatsapp from "@hyperjumptech/whatsapp-business-sender";

const resp = await whatsapp.sendMessageTemplateText(
"",
"",
{
phone: "",
template: {
namespace: "",
name: "",
language: {
policy: "",
code: "",
},
components: [
{
type: "body",
parameters: [
{
type: "",
text: "",
},
],
},
],
},
}
);
```

## Discussions

If you need help, want to give feedback, or have a great idea to improve this library, get involved! Let us know in the [Github discussions](https://github.com/hyperjumptech/whatsapp-business-sender/discussions).

Please abide by the [Contributor's Code of Conduct](CODE_OF_CONDUCTS.md)

## License

[MIT](./LICENSE.txt) License.