# smsgate

> Node.js Client for using SMS Gate HTTP API

Latest version **1.0.1** (published 2022-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install smsgate
pnpm add smsgate
yarn add smsgate
bun add smsgate
```

## 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.1 |
| Published | 2022-02-18 |
| First published | 2019-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.0.0 |
| Dependencies | 0 |
| Unpacked size | 8.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Maintainers | rukavina |
| Keywords | sms, bulk, send, messaging |

## Links

- npm: https://www.npmjs.com/package/smsgate
- Repository: https://github.com/horisen/smsgate-smshttpclient-node
- Homepage: https://github.com/horisen/smsgate-smshttpclient-node#readme
- Issues: https://github.com/horisen/smsgate-smshttpclient-node/issues
- npm.io page: https://npm.io/package/smsgate

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2022-02-18
- 1.0.0 — 2019-03-08

## README

# Node.js library for SMS Gate

*This library requires a minimum node.js version of 7*


## Installation

```bash
npm install smsgate
```

## Send SMS

```js
const SMSGate = require("smsgate");

//make sure to set the real sms gate url
let gate = new SMSGate.Client('http://localhost:9000/bulk_server')
gate.send({
    "type": "text",
    "auth": { "username": "testuser", "password": "testpassword" },
    "sender": "BulkTest",
    "receiver": "4179123456",
    "dcs": SMSGate.DCS_GSM,
    "text": "This is test message with expected DLR",
    "dlrUrl": "http://localhost:8000/dlr", //make sure to set your real webhook handler url
    "dlrMask": SMSGate.DLR_MASK_STANDARD
}).then(response => {
    console.log("SMS sent", response);
}).catch(error => {
    console.log("SMS error", error);
});
```

## Receive DLRs

```js
//depending if you are using a framework or not, it might vary
//in general raw body payload should be parsed into js object
let dlr =JSON.parse(body);
console.log("DLR received", dlr);
```

Check `examples` directory for more details.
To run examples locally run from the command line

```bash
cd examples
node index.js
```

and then open `http://localhost:8000/`

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