# spryng-sms

> Client for the Spryng SMS Gateway API

Latest version **1.2.0** (published 2022-08-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install spryng-sms
pnpm add spryng-sms
yarn add spryng-sms
bun add spryng-sms
```

## 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.2.0 |
| Published | 2022-08-31 |
| First published | 2016-07-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 18.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Sandrino Di Mattia |
| Maintainers | sandrinodimattia |
| Keywords | sms, spryng |

## Links

- npm: https://www.npmjs.com/package/spryng-sms
- Repository: https://github.com/sandrinodimattia/node-spryng-sms
- Homepage: https://github.com/sandrinodimattia/node-spryng-sms#readme
- Issues: https://github.com/sandrinodimattia/node-spryng-sms/issues
- npm.io page: https://npm.io/package/spryng-sms

## Dependencies (3)

- [request](https://npm.io/package/request.md) ^2.74.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.4.1
- [request-promise](https://npm.io/package/request-promise.md) ^4.1.0

## Recent versions

- 1.2.0 (latest) — 2022-08-31
- 1.1.0 — 2016-08-01
- 1.0.1 — 2016-07-31
- 1.0.0 — 2016-07-31

## README

# Node.js client for the Spryng SMS Gateway API

> npm install --save spryng-sms

## Usage

This sample shows how to initiate the client and send a text message:

```js
// ES5
const SmsApiClient = require('spryng-sms').SmsApiClient;

// ES6
import { SmsApiClient } from 'spryng-sms';

const client = new SmsApiClient({
  username: 'my-account',
  password: 'my-password'
});

const request = {
  allowLong: true,
  destination: '32123456789',
  route: 'BUSINESS', // or ECONOMY
  body: 'Hi there, this is a message.',
  sender: '0032111111111',
  reference: '1234567890'
};

client.send(request)
  .then(() => {
    console.log('SMS message has been sent.');
  })
  .catch(err => {
    console.log('Error sending SMS:', err);
  });
```

### Sending to multiple destinations

You can also specify multiple destinations:

```js
const request = {
  allowLong: true,
  destination: [ '32123456789', '32987654321' ],
  route: 'BUSINESS', // or ECONOMY
  body: 'Hi there, this is a message.',
  sender: '0032111111111',
  reference: '1234567890'
};

client.send(request)
  .then(() => {
    console.log('SMS message has been sent.');
  })
  .catch(err => {
    console.log('Error sending SMS:', err);
  });
```

### Checking your credit

```js
client.getRemainingCredit()
  .then((credit) => {
    console.log('Remaining credit:', credit);
  })
  .catch(err => {
    console.log(err);
  });
```

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