# apiai

> Node.js SDK for api.ai

Latest version **4.0.3** (published 2017-07-11) · Apache 2.0 license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.3 |
| Published | 2017-07-11 |
| First published | 2015-07-17 |
| Weekly downloads | 0 |
| License | Apache 2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dmitriy Kuragin |
| Maintainers | sstepashka |
| Keywords | apiai, NLU, natural, language, understanding |

## Links

- npm: https://www.npmjs.com/package/apiai
- Repository: https://github.com/api-ai/apiai-nodejs-client
- Homepage: https://github.com/api-ai/api-ai-node-js#readme
- Issues: https://github.com/api-ai/api-ai-node-js/issues
- npm.io page: https://npm.io/package/apiai

## Recent versions

- 4.0.3 (latest) — 2017-07-11
- 4.0.2 — 2017-04-06
- 4.0.1 — 2017-03-07
- 4.0.0 — 2017-02-03
- 3.0.3 — 2016-11-23
- 3.0.2 — 2016-10-18
- 3.0.1 — 2016-10-13
- 3.0.0 — 2016-10-10
- 2.0.7 — 2016-08-24
- 2.0.6 — 2016-08-24
- 2.0.5 — 2016-05-16
- 2.0.4 — 2016-05-16
- 2.0.3 — 2016-05-11
- 2.0.2 — 2016-05-11
- 2.0.1 — 2016-04-25
- … 10 more at https://npm.io/package/apiai/versions

## README

# Node.js SDK for Api.ai

This plugin allows integrating agents from the [Api.ai](http://api.ai) natural language processing service with your Node.js application.

* [Installation](#installation)
* [Usage](#usage)

# Installation

* Install [Node.js](https://nodejs.org/)
* Install Api.ai SDK with `npm`:
```shell
npm install apiai
```

# Usage
* Create `main.js` file with the following code:
```javascript
var apiai = require('apiai');

var app = apiai("<your client access token>");

var request = app.textRequest('<Your text query>', {
    sessionId: '<unique session id>'
});

request.on('response', function(response) {
    console.log(response);
});

request.on('error', function(error) {
    console.log(error);
});

request.end();
```
* Run following command.
```shell
node main.js
```
* Your can find more examples in [`samples`](samples) directory.

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