# mta-api

> A Node.js wrapper for the Mobile Text Alerts (MTA) v.3 API.

Latest version **2.0.2** (published 2021-06-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install mta-api
pnpm add mta-api
yarn add mta-api
bun add mta-api
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2021-06-01 |
| First published | 2020-11-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 20.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Vimbly Group |
| Maintainers | noelpicinich |

## Links

- npm: https://www.npmjs.com/package/mta-api
- Repository: https://github.com/mobiletextalerts/sdk-node
- Homepage: https://github.com/mobiletextalerts/sdk-node.git#readme
- Issues: https://github.com/mobiletextalerts/sdk-node.git/issues
- npm.io page: https://npm.io/package/mta-api

## Recent versions

- 2.0.2 (latest) — 2021-06-01
- 2.0.1 — 2021-05-12
- 2.0.0 — 2021-05-12
- 1.0.3 — 2021-01-28
- 1.0.2 — 2020-12-04
- 1.0.1 — 2020-11-17
- 1.0.0 — 2020-11-17

## README

# MTA API
A Node.js wrapper for the Mobile Text Alerts (MTA) v.3 API.

## Installation
```bash
$ npm install mta-api --save
```
## Load Module

### TypeScript
```typescript
import { MTAApi } from 'mta-api';
```
### JavaScript
```javascript
const { MTAApi } = require('mta-api');
```

```javascript
const mta = new MTAApi("your-api-key");

let recipientPhone = '1-222-222-2222';

try {
    recipientPhone = MTAApi.formatPhoneNumber(recipientPhone);
} catch (e) {
    console.error(e.message);
    process.exit(130);
}

const requestData = {
    subscribers: [recipientPhone],
    message: "Hello World!"
}

mta.Send.sendSMS(requestData).then((response) => {
    console.log(response);
    process.exit(0);
}).catch((e) => {
    console.error(e.message);
    process.exit(130);
});
```

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