ito is a JavaScript library for browser-to-browser communication, which is intended to work on devices without an input human interface like keyboard or mouse, of course as well as PCs, smartphones and tablets.
This library is composed of two layers; application and backend interface layers. The application interface layer provides a set of APIs for JavaScript-based web applications. The backend interface layer works as a bridge between the application interface and a backend service. As a backend service, Firebase and Kii Cloud are supported currently.
"ito" is a Japanese word "糸" which means "string", "thread" or "yarn", and is also an anagram of "IoT".
Copyright (c) 2017 KDDI Research, Inc.
This software is released under the MIT License, see LICENSE file.
When using this library, you MUST follow Terms of Service for each backend service which you use with this library:
ito provides web applications running on browsers and web servers running on Node.js with the following features:
- account and authentication
- friend list, as a whitelist of connectable accounts
- messaging and Notifications
- WebRTC peer-to-peer communication (browsers only)
- simple database sharing
- Browser or Node.js, compatible with ES2015(ES6)
- If you need to run your web application on an ES5 environment,
please use the ES5-transpiled files,
src-es5/ito*.js
.
- If you need to run your web application on an ES5 environment,
please use the ES5-transpiled files,
- WebRTC compatibility (when using WebRTC peer-to-peer communication)
- A developer account for one of the following backend service(s):
- Create your Firebase project at Firebase Console.
- Configure Authentication -> Sign-in method (if needed).
- Select Sign-in providers as you need. For Facebook, App ID, App secret and OAuth redirect URI must be configured as well.
- Add your domain to OAuth redirect domains.
- Note: GitHub and Twitter are not supported yet.
- Copy and paste
etc/firebase-rules.json
into Database -> Rules. - Confirm the snippet from Authentication -> Web setup, and note down
the values of
apiKey
,authDomain
anddatabaseURL
. These values are used inito.init()
.
Note: Node.js is required to initialize a Kii Cloud application.
- Create your app at Kii Developer Portal.
- Choose HTML5 as your application's platform.
- Choose a server location appropriate for you.
- For detailed information, please refer to http://docs.kii.com/en/guides/cloudsdk/javascript/quickstart/create-app/.
- Configure social network settings (if needed).
- For detailed information, please refer to http://docs.kii.com/en/guides/cloudsdk/javascript/managing-users/social-network-integration/.
- Confirm your APP ID, APP KEY, CLIENT ID and CLIENT SECRET.
- These values are required to initialize your Kii Cloud application (see 4.) and deploy Server Code (see 5.).
- The values of APP ID and APP KEY are used in
ito.init()
. - For detailed information, please refer to http://docs.kii.com/en/guides/cloudsdk/javascript/quickstart/create-app/#checking-appid-and-appkey.
- Run the script
etc/kii-init.js
by Node.js on your shell (Terminal, etc.), as follows:$ node etc/kii-init.js \ --site [us|eu|cn3|sg|jp] \ --app-id <your_app_id> \ --app-key <your_app_key> \ --client-id <your_client_id> \ --client-secret <your_client_secret>
- Deploy
etc/kii-server-code.js
as Server Code withetc/kii-server-hook.json
as Server hook Configuration File, by using Command Line Tools. For example:$ node kii-cli/bin/kii-servercode.js deploy-file \ --file etc/kii-server-code.js \ --site [us|eu|cn3|sg|jp] \ --app-id <your_app_id> \ --app-key <your_app_key> \ --client-id <your_client_id> \ --client-secret <your_client_secret> \ --hook-config etc/kii-server-hook.json
Note: You can modify paths of scripts according to your environment.
<script src="src/ito.js"></script>
<script src="src/ito-firebase.js"></script>
<script src="src/ito.js"></script>
<script src="src/ito-kii.js"></script>
On your shell (Terminal, etc.),
$ npm install ito-js --save
In your web application,
let ito = require('ito-js');
For detailed description of API, please refer to the API documentation.