# kaia-services.js

> JS library for Kaia.ai services

Latest version **0.0.3** (published 2018-12-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install kaia-services.js
pnpm add kaia-services.js
yarn add kaia-services.js
bun add kaia-services.js
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2018-12-05 |
| First published | 2018-11-27 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 216 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | OOMWOO LLC |
| Maintainers | kaiaai |
| Keywords | kaia.ai, robotics, deep learning, tensorflow, slam, arduino, robot, self-driving, image recognition, image classification, tensorflow.js, speech recognition, kaia, messaging |

## Links

- npm: https://www.npmjs.com/package/kaia-services.js
- Repository: https://github.com/kaiaai/kaia-services.js
- Homepage: https://github.com/kaiaai/kaia-services.js#readme
- Issues: https://github.com/kaiaai/kaia-services.js/issues
- npm.io page: https://npm.io/package/kaia-services.js

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2018-12-05
- 0.0.2 — 2018-11-27
- 0.0.1 — 2018-11-27

## README

# Kaia-services.js
Services provided by Kaia.ai platform.

We have not yet launched the platform. For launch announcement please follow us on [Facebook](https://www.facebook.com/kaiaai/).

## Live Demos
- Browse [sample apps](https://github.com/kaiaai/sample-apps) for live demos, source code

## Installation
Kaia.ai robot apps run on Android smartphones. To run sample apps:
1. Go to [kaia.ai](https://kaia.ai/), familiarize yourself with how the robot platform works
2. Optional, but highly recommended: if you don't have Kaia.ai account, create an account
3. Go to Google Play, search for "kaia.ai" to find and install Kaia.ai Android app
4. Launch Kaia.ai Android app on your Android smartphone
5. In Kaia.ai Android app: (optional, but highly recommended): sign in, navigate to Kaia.ai App Store
6. Choose a robot app to launch
7. Optionally: click the heart icon to pin the robot app to your launch screen

## API Overview

### Messaging

- Remote Console sample app, [Live Demo](https://kaia.ai/view-app/5aa78c8f1f0267133aedce1c), [Source](https://github.com/kaiaai/sample-apps/tree/master/remote-console)
- Remote Debug sample app, [Live Demo](https://kaia.ai/view-app/5bfcedb875527d379800bb86), [Source](https://github.com/kaiaai/sample-apps/tree/master/remote-debug)

```js
let messaging = await createMessaging({ io: io(), eventListener: onMessageEvent, rooms: 'myRoom' });
// Send string or objects
messaging.send('Hello');
messaging.send({ firstName: 'Mary', lastName: 'Jane'});
...
  function onMessageEvent(err, msg) {
    if (err) {
      print ('Error ' + err);
      return;
    }
    
    switch (msg.event) {
      case 'message':
        print(msg.client + ' in room ' + msg.room + ' says ' + msg.message);
        break;
      case 'joined':
        print('  ' + msg.room + ' clients now are ' + msg.clients);
        print(msg.client + ' joined room ' + msg.room);
        break;
      case 'left':
        print('  ' + msg.room + ' clients now are ' + msg.clients);
        print(msg.client + ' left room ' + msg.room);
        break;
      case 'reconnect':
        print('Reconnected');
        break;
      case 'disconnect':
        print('Disconnected');
        break;
    }
  }
```

## Installing

### Via npm + webpack/rollup

```sh
npm install kaia-messaging.js
```

Now you can require/import `kaia-messaging.js`:

```js
import { createMessaging } from 'kaia-messaging.js';
```

### Via `<script>`

* `dist/kaia-services.mjs` is a valid JS module.
* `dist/kaia-services-iife.js` can be used in browsers that don't support modules. `kaiaServicesJs` is created as a global.
* `dist/kaia-services-iife.min.js` As above, but minified.
* `dist/kaia-services-iife-compat.min.js` As above, but works in older browsers such as IE 10.
* `dist/kaia-services-amd.js` is an AMD module.
* `dist/kaia-services-amd.min.js` is a minified AMD module.

These built versions are also available on jsDelivr, e.g.:

```html
<script src="https://cdn.jsdelivr.net/npm/kaia.js/dist/kaia-services-iife.min.js"></script>
<!-- Or in modern browsers: -->
<script type="module">
  import { createMessaging } from 'https://cdn.jsdelivr.net/npm/kaia-services.js';
</script>
```
and unpkg
```html
<script src="https://unpkg.com/kaia.js/dist/kaia-services-iife.min.js"></script>
<!-- Or in modern browsers: -->
<script type="module">
  import { createMessaging } from 'https://unpkg.com/kaia-services.js';
</script>
```

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