In the read me file it gives you a basic code
// run this in multiple tabs!
var intercom = Intercom.getInstance();
intercom.on('notice', function(data) {
console.log(data.message);
});
intercom.emit('notice', {message: 'Hello, all windows!'});
Put the emit code on the page with the button, put the on code on the page where you want the alert to appear [of course change the console line to an alert.]
So making the alert happen would be:
Page 1 [Page with the alert]:
var intercom = Intercom.getInstance();
intercom.on('notice', function(data) {
alert(data.message);
});
Page 2 [Page with the button]:
function broadcast () {
var intercom = Intercom.getInstance();
intercom.emit('notice', {message: 'Hello, all windows!'});
}
document.getElementById("myButtonId").addEventListener("click", broadcast , false);