# iii-client

> Simple API for communicating with the bot of the "iii.ru" service.

Latest version **3.2.2** (published 2017-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install iii-client
pnpm add iii-client
yarn add iii-client
bun add iii-client
```

## 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 | 3.2.2 |
| Published | 2017-11-08 |
| First published | 2017-05-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Valentin Popov |
| Maintainers | valentineus |
| Keywords | simple, client, iii, bot |

## Links

- npm: https://www.npmjs.com/package/iii-client
- Repository: https://github.com/valentineus/iii-client
- Issues: https://github.com/valentineus/iii-client/issues
- npm.io page: https://npm.io/package/iii-client

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.2.2 (latest) — 2017-11-08
- 3.2.1 — 2017-10-10
- 3.2.0 — 2017-10-09
- 3.0.1 — 2017-09-28
- 2.1.0 — 2017-09-28
- 2.0.1 — 2017-09-05
- 2.0.0 — 2017-07-29
- 1.1.3 — 2017-06-14
- 1.1.2 — 2017-06-10
- 1.1.1 — 2017-06-05
- 1.1.0 — 2017-06-04
- 1.0.0 — 2017-05-30
- 0.0.3 — 2017-05-29
- 0.0.2 — 2017-05-28

## README

# III Client

[![GitHub Release](https://img.shields.io/github/release/valentineus/iii-client.svg)](https://github.com/valentineus/iii-client/releases)
[![NPM](https://img.shields.io/npm/v/iii-client.svg)](https://www.npmjs.com/package/iii-client)
[![Build Status](https://travis-ci.org/valentineus/iii-client.svg?branch=master)](https://travis-ci.org/valentineus/iii-client)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/81b2fdc2f5dd42a6bdc8fdb43640b282)](https://www.codacy.com/app/valentineus/iii-client)
[![Codacy Coverage Badge](https://api.codacy.com/project/badge/Coverage/81b2fdc2f5dd42a6bdc8fdb43640b282)](https://www.codacy.com/app/valentineus/iii-client/files)
[![Gitter Badge](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/valentineus/iii-client)

Simple API for communicating with the bot of the \"iii.ru\" service.

## Features

- Multiplatform library.
- A small and light library.
- Getting session ID.
- Sending and receiving messages.

## Installation

NodeJS:
```bash
npm install --save iii-client
```

Browser:
```html
<script src="https://unpkg.com/iii-client@latest/dist/bundle.js">
    /* iiiClient - This is the global name for accessing the package */
</script>
```

## Using

An example of a connection, receiving session identification and sending a bot message:
```javascript
import { connect, send } from 'iii-client';

var uuid = '109cd867-0ef3-4473-af71-7543a9b2fccd';
var cuid = '0340feab-b09e-4960-96e9-c9518b1fb157';
var text = 'Hello, World!';

/* We connect to the system and get a session */
connect(uuid, (request) => {
    console.info(`Session: ${request.result.cuid}`);
});

/* Send the message and process the response */
send(cuid, text, (answer) => {
    console.info(`Answer: ${answer.result.text.value}`);
});
```

## API

## Functions

<dl>
    <dt>
        <a href="#connect">connect(uuid, callback)</a>
    </dt>
    <dd>
        <p>Connection to the service and retrieves the session identifier.</p>
    </dd>
    <dt>
        <a href="#send">send(cuid, text, callback)</a>
    </dt>
    <dd>
        <p>Sends a message to bot and returns a response.</p>
    </dd>
</dl>

<a name="connect"></a>

## connect(uuid, callback)

Connection to the service and retrieves the session identifier.

| Param | Type | Description |
| --- | --- | --- |
| uuid | <code>String</code> | Bot ID |
| callback | <code>function</code> | Function handler |

<a name="send"></a>

## send(uuid, text, callback)

Sends a message to bot and returns a response.

| Param | Type | Description |
| --- | --- | --- |
| uuid | <code>String</code> | Session ID |
| text | <code>String</code> | The message you are sending |
| callback | <code>function</code> | Function handler |

## License

[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/eslint/eslint)

[MIT](LICENSE.md).
Copyright (c)
[Valentin Popov](https://valentineus.link/).

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