# text-kenya

> Client wrapper for InfoPi (formerly Text Kenya) web service

Latest version **1.1.3** (published 2021-11-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install text-kenya
pnpm add text-kenya
yarn add text-kenya
bun add text-kenya
```

## 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.1.3 |
| Published | 2021-11-15 |
| First published | 2016-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Tony Mutai |
| Maintainers | lestoni |
| Keywords | text-kenya, infopi, sms |

## Links

- npm: https://www.npmjs.com/package/text-kenya
- Repository: https://github.com/lestoni/text-kenya
- Homepage: https://github.com/lestoni/text-kenya#readme
- Issues: https://github.com/lestoni/text-kenya/issues
- npm.io page: https://npm.io/package/text-kenya

## Dependencies (2)

- [merge](https://npm.io/package/merge.md) ^2.1.1
- [request](https://npm.io/package/request.md) ^2.72.0

## Recent versions

- 1.1.3 (latest) — 2021-11-15
- 1.1.0 — 2016-10-21
- 1.0.0 — 2016-05-25

## README

# text-kenya

Client wrapper for Text Kenya Web Service.

[![Made in Africa](https://img.shields.io/badge/Africa's%20Rising-%E2%9C%93-green.svg)](https://github.com/collections/made-in-africa)

## Install.

```
$ npm install text-kenya
```

## Examples.

```javascript
  var textKenya = require('text-kenya');
  var data = { u: 'username', h: 'token', to: '0700112233', msg: 'To SMS and Infinity' };

  textKenya.sendSMS(data, function (err, response) {
    if(err) return console.log(err);

    // operate on response here
    console.log(response);
  });
```
## API.

**textKenya.sendSMS(data#Object, cb(err, response)#Function)**

Send SMS to a single or multiple numbers

`data` params:
  - mandatory: `to`, `msg`, `u`, `h`
  - optional: `type`, `unicode`, `from`, `footer`, `nofooter`, `format`

**textKenya.outgoingSMS(data#Object, cb(err, response)#Function)**

Outgoing SMS and delivery status

`data` params:
  - mandatory: `u`, `h`
  - optional: `queue`, `src`, `dst`, `dt`, `smslog_id`, `c`, `last`, `format`

**textKenya.incomingSMS(data#Object, cb(err, response)#Function)**

List Incoming SMS

`data` params:
  - mandatory: `u`, `h`
  - optional: `queue`, `src`, `dst`, `dt`, `smslog_id`, `c`, `last`, `format`

**textKenya.showInbox(data#Object, cb(err, response)#Function)**

List SMS on user's inbox.

`data` params:
  - mandatory: `u`, `h`
  - optional: `queue`, `src`, `dst`, `dt`, `smslog_id`, `c`, `last`, `format`

**textKenya.getUserCredit(data#Object, cb(err, response)#Function)**

Get user's credit information.

`data` params:
  - mandatory: `u`, `h`
  - optional: `format`

**textKenya.getToken(data#Object, cb(err, response)#Function)**

Get user's webservice token. This can be used as a login mechanism.

`data` params:
  - mandatory: `u`, `p`
  - optional: `format`

**textKenya.setToken(data#Object, cb(err, response)#Function)**

Set user's webservice token. This can be used as a password change mechanism.

`data` params:
  - mandatory: `u`, `h`
  - optional: `format`

**textKenya.getContactList(data#Object, cb(err, response)#Function)**

Get contact list by code or name

`data` params:
  - mandatory: `u`, `h`, `kwd`
  - optional: `format`, `c`

**textKenya.serverInfo(data#Object, cb(err, response)#Function)**

Query server for useful information such as user's data, user's credit, last smslog_id for inbox,incoming and outgoing SMS

`data` params:
  - mandatory: `u`, `h`
  - optional: `format`

## LICENSE.

MIT.

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