Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

Pusher is a hosted service that enables us to easily push real-time data to our application (using WebSockets). It is needed to get the most out of the "KPI & Alerting" Impac! feature, which send real-time Alerts to the front-end notifying Users when their KPI's (key performance indicators) have been reached.


For the JavaScript client (Impac! Angular) to receive notifications from our server (Impac!) via the Pusher servers, a "Client Key" must be provided, and it must match the "Client Key" configured. For Impac! to send notifications to the client via Pusher, Impac! must be configured with an "Api Key", "Api Secret" & "Client Key. 

This document will guide you through setting up a Pusher account, and configuring the Maestrano products to enable the use of Pusher.





1 - Creating a Pusher Account & Generating API Keys

  1. First go to https://dashboard.pusher.com/accounts/sign_up and sign up
     
  2. Once you create an account, this should be the first screen you see. Fill in the fields (5 & 6 not important).


  3. We recommend the "create apps for multiple environments" option


  4. Select the "Your Apps" menu icon on the left sidebar, and select the correct application / application environment


  5. Then on the app top-bar menu, select "App Keys"


  6. Now you should see all the app keys required


2 - Configuring Impac! API with the Pusher API Keys

Impac! API stores the Pusher API Keys as environment variables. Below are the recommended options to configure these variables.

2.1 - Option 1 (Nex!):

  1. Add the API Keys as environment variables of your app through Nex!.
nex-cli apps:vars impac-app-name --add PUSHER_APP_ID=app-id-key,PUSHER_KEY=key,PUSHER_SECRET=secret


2.2 - Option 2 (Ansible):

  1. For adding ENV variables to Impac! through Ansible, you need to add it here: https://github.com/maestrano/mno-deploy/blob/develop/ansible/roles/impac/templates/application.yml
  2. As these are secret keys, it will need to be encrypted using Ansible Vault (https://github.com/maestrano/mno-deploy/blob/develop/ansible/vars/example_secrets.yml)

3 - Configuring the front-end with the Pusher Client Key

Your Maestrano Enterprise Rails application can configured with the pusher client key as an environment variable, which then gets provided to the front-end (Impac! Angular) during Angular's configuration phase. Otherwise, Impac! Angular can be configured directly by following Option 2 below.

3.1 - Option 1 (Nex!):

  1. Add the Pusher Client Key as an environment variable of your app through Nex!.
nex-cli apps:var app-name --add impac_pusher_key=the-pusher-client-key

3.2 - Option 2 (manual front-end configuration):

  1. Add the pusher client key to your Express project's front-end Impac! configuration file (frontend/src/app/impac.config.coffee). 
angular.module('mnoEnterpriseAngular').run((ImpacLinking)->
	ImpacLinking.linkData({
		pusher_key: 'pusher-client-key'
	})
)
  • No labels