1.0.0 • Public • Published

Heimdall Client

Library to easily use the Heimdall global events system within a project

See Diagram

Installing the NPM Module

You need to be logged into NPM to use this private module.

npm login
npm install @satthief/heimdall-client --add

Quick Use

const heimdall = require('@satthief/heimdall-client');

//make a client to interact with
var hdc_config = {


  //Example trigger handler config - DYNAMIC QUEUE - Beware!
  var handler_config_dynamic = {
      console.log('handler got',data);
      return cb();

  //Example trigger handler config - STATIC QUEUE - Need to bind manually on RabbitMQ
  var handler_config_static = {
      console.log('handler got',data);
      return cb();

  //Example of registering for trigger on an event global.test.werner
  var regtrigger = {
      "events": {
          "test_event": {
              "path": "global.test.werner",
              "mechanism": "evt"
    'trigger': {
        "on_trigger": {
            "default_deregister": true
        "system": {
            "type": "rabbitmq",
            "exchange": "/exchange/ex-heimdall-triggers",
            "topic": "example-heimdall-client-app",
            "server": "mq01",
        "triggerdata": {
            "eventdata_here": {

  //Example of an event to emit
  var event = {
    "path": "global.test.werner",
    "eventdata": {
        "girl": "monalisa"

  //Do all 3 actions in series - Callback method
    console.log('Back from setup_trigger_handler');
      console.log('Back from register_trigger');
      true ? hdc.emit_event(event,function(err){
        console.log('Back from emit_event');
      }) : false;


Notes and Links

Choose 1 of 2 methods for receiving triggers

  1. explicit queue setup you setup a queue on RabbitMQ for your application and then bind the queue via a topic to ex-heimdall-triggers, then use this queue in your trigger handler config

  2. dynamic queue you specify dynamic and a topic in the heimdall trigger handler config, this connects to RabbitMQ and makes a dynamic subscription, it is linked to the exchange

  • disadvantages of this method are that when you disconnect the queue gets removed and triggers will go missing
  • each instance of the app will have its own queue, duplicates are possible ??
  • see more at

Copyright Werner Stucky All rights reserved

Package Sidebar


npm i stubber-heimdall-client

Weekly Downloads






Unpacked Size

10.8 kB

Total Files


Last publish


  • ivanstubber