# @premiumfastnet/wsgateway

> Library Package For WSGateway API

Latest version **1.0.2** (published 2020-03-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @premiumfastnet/wsgateway
pnpm add @premiumfastnet/wsgateway
yarn add @premiumfastnet/wsgateway
bun add @premiumfastnet/wsgateway
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-03-13 |
| First published | 2019-11-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 (+25 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Premium Fast Network |
| Maintainers | juniyadi |

## Links

- npm: https://www.npmjs.com/package/@premiumfastnet/wsgateway
- Repository: https://github.com/Premium-Fast-Network/wsgateway-node
- Homepage: https://github.com/Premium-Fast-Network/wsgateway-node#readme
- Issues: https://github.com/Premium-Fast-Network/wsgateway-node/issues
- npm.io page: https://npm.io/package/@premiumfastnet/wsgateway

## Dependencies (1)

- [axios](https://npm.io/package/axios.md) ^0.19.0

## Recent versions

- 1.0.2 (latest) — 2020-03-13
- 1.0.1 — 2019-11-19
- 1.0.0 — 2019-11-19

## README

# PFN NodeJS Library WSGateway

[![npm version](https://badge.fury.io/js/%40premiumfastnet%2Fwsgateway.png)](https://badge.fury.io/js/%40premiumfastnet%2Fwsgateway)

This library for easy to use in NodeJS with NPM or Yarn installation. Please referer to our [REST API Documentation](https://docs.premiumfast.net/tutorials/whatsapp-gateway/rest-api) if you want to build in your own programing language.

## Installation

```
npm i @premiumfastnet/wsgateway
```

# How to Use

## Send Message Example

- Request
```javascript
const wa = new WSGateway()
wa.token = 'YOUR-TOKEN-HERE'
wa.deviceid = 'YOUR-DEVICE-ID'
wa.sendmessage('0812xxxxxxxx','test from nodejs')
.then((res) => {
    console.log(res.data)
})
.catch((err) => {
    console.error(err)
})
```

- Response
```
{
    code: 200,
    message: 'success, message will be send in background.'
}
```

## Send Bulk Message Example

- Request
```javascript
const wa = new WSGateway()
wa.token = 'YOUR-TOKEN-HERE'
wa.deviceid = 'YOUR-DEVICE-ID'
wa.sendmessage(['08xxxx', '08xxxxx'],'test from nodejs')
.then((res) => {
    console.log(res.data)
})
.catch((err) => {
    console.error(err)
})
```

- Response
```
{
    code: 200,
    message: 'success, all message in waiting list.'
}
```

## Send Bulk Message to Contact Group

- Request
```javascript
const wa = new WSGateway()
wa.token = 'YOUR-TOKEN-HERE'
wa.deviceid = 'YOUR-DEVICE-ID'
wa.sendgroup('xxxx', 'test from nodejs')
.then((res) => {
    console.log(res.data)
})
.catch((err) => {
    console.error(err)
})
```

- Response
```
{
    code: 200,
    message: 'success, all message in waiting list.'
}
```

---
_Source: https://npm.io/package/@premiumfastnet/wsgateway · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
