ito - a JavaScript library for browser-to-browser communication

get started

About ito

ito is a JavaScript library for browser-to-browser communication, intended to work on devices without an input human interface like keyboard or mouse, of course as well as PCs, smartphones and tablets.

ito runs on JavaScript-enabled platforms, both HTML5 browsers and Node.js. You can deploy ito for browser-enabled IoT devices like Raspberry Pi, CHIRIMEN, etc. which do not have input devices like keyboard or mouse, or are not connected to any display.

Typical JavaScript codes to use ito looks like below:

ito.init({ /* initialization parameters */ });

document.getElementById('submit').onclick = () => {
  ito.send(peerId, document.getElementById('textarea').value);
};

ito.on('message', event => {
  document.getElementById('div').textContent = event.data;
});

Server-less setup

Applicaiton server infrastructure, e.g. Node.js, Java Servlet, is not needed.

Instead, only setting up Firebase or Kii Cloud and writing web apps is required. All features like device ID management, pairing, browser-to-browser messaging and data base sharing are provided through the ito library and cloud services.

Pairing and messaging

No need to type a long ID like UUID, to connect with a peer. Short passcode is enough.

ito supports browser-to-browser pairing using a passcode. You can use 6-8 letters passcode for pairing. Of course, you can even generate random temporary passcode and encode it as a QR code. Also, such use of passcode can keep the actual ID invisible until establishing pairing, for the purpose of privacy protection.

// at an IoT device waiting for pairing request
ito.setPasscode(passcode).then(() => {
  ito.on('request', event => {
    event.accept();
  });
}, () => {
  console.log('The specified passcode is already in use.')
});

ito.on('addfriend', event => {
  console.log('Paired with the user: ID = ' + event.uid);
});
// at a web browser as a device controller
ito.request(document.getElementById('passcode').value).catch(() => {
  alert('No device for the specified passcode is found.');
});

ito.on('accept', event => {
  alert('Paired with the device: ID = ' + event.profile.uid);
});

Other features

Further detail is available in README.md on GitHub Repository.

How to use ito

Short installation guide is available in how-to page.

For further information about API, please refer to API.md on GitHub Repository.