appygram module to talk to @appygram messaging service
An Appygram connector
var appygram = require'appygram';//Make sure to use app.router; otherwise this middleware will not workappuseapprouter;appygramsetApiKey'your_api_key';appuseappygramerrorHandler;
appygram lets you add a user object to the trace it sends. It defaults to not sending a user object. To enable do
appygraminclude_user = true;
It defaults to the location of
req['user']. To change this do
appygramuser_location = "user_session_obj"
Note appygram only will support the user location if it is in the req object.
To change the 'software' set with a trace object do
appygramapp_name = "my awesome express app"
Otherwise it will default to "node application"
If you need to reset the appygram object for some reason a method is exposed to handle this for you.
You can see some basic examples here.
var appygram = require'appygram';appygramsetApiKey'api_key';appygramsendFeedbackname:'Will'topic:'Feedback'message:'I am sending an appygram!'email:'email@example.com'//done sending feedback;
Most of the options for the express route are available to this method with the exception of the include user option.