chirpers

JavaScript client for chirpers.io

Usage no npm install needed!

<script type="module">
  import chirpers from 'https://cdn.skypack.dev/chirpers';
</script>

README

Chirpers

JavaScript client for chirpers.com

npm install chirpers

usage

const Chirpers = require('chirpers');

const chirp = new Chirpers({uuid: '<my device uuid>', token: '<my token>'});


chirp.on('message', (topic, msg) => {
    console.log('msg', topic, msg);
});

//send direct message
chirp.publish('<uuid of a friend>', {payload: 'hello, friend!'});


//send to any subscriber
chirp.broadcast({payload: 'hello, world!'});


//subscribe to broadcasts from another device
chirp.subBroadcasts('<uuid of a friend>')