hestia.io-client

0.1.2 • Public • Published

hestia.io-client

npm version

This is the client library of Hestia.io.

Usage

The client library consists of two files

  • hestia.js (index.js): Communicate with Hestia server
    • The client of the Hestia server must include this file
  • appHeader.js: Communicate with server app
    • The client-side app must include this file

Both files are served automatically by Hestia as /hestia.js and /appHeader.js. They're also available in /dist of this repo.

<script src="/hestia.js"></script>
<script>
// Pass in root element where app’s iframe should be created
const socket = hestia(document.getElementById('root'));

socket.emit('start', 'Dingus');
socket.on('confirm', () => {
  console.log('Hello Dingus!');
});
</script>

app.js:

<script src="/appHeader.js"></script>
<script>
  app.on('foo', () => {
    app.emit('bar');
  });
</script>

Documentation

Full documentation coming soon!

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i hestia.io-client

Weekly Downloads

4

Version

0.1.2

License

MIT

Unpacked Size

5.92 kB

Total Files

5

Last publish

Collaborators

  • michaelkim