Services provided by Kaia.ai platform.
We have not yet launched the platform. For launch announcement please follow us on Facebook.
- Browse sample apps for live demos, source code
Kaia.ai robot apps run on Android smartphones. To run sample apps:
- Go to kaia.ai, familiarize yourself with how the robot platform works
- Optional, but highly recommended: if you don't have Kaia.ai account, create an account
- Go to Google Play, search for "kaia.ai" to find and install Kaia.ai Android app
- Launch Kaia.ai Android app on your Android smartphone
- In Kaia.ai Android app: (optional, but highly recommended): sign in, navigate to Kaia.ai App Store
- Choose a robot app to launch
- Optionally: click the heart icon to pin the robot app to your launch screen
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;
}
}
npm install kaia-messaging.js
Now you can require/import kaia-messaging.js
:
import { createMessaging } from 'kaia-messaging.js';
-
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.:
<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
<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>