Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
An Appygram connector
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
coffee
lib
test
.gitignore
.npmignore
.travis.yml
Cakefile
LICENSE
README.md
package.json

README.md

Appygram-node

An Appygram connector

Build Status

Build
Status

Installation

npm install appygram --save

Usage

Express

  var appygram = require('appygram');
  ...
  //Make sure to use app.router; otherwise this middleware will not work
  app.use(app.router);
  appygram.setApiKey('your_api_key');
  app.use(appygram.errorHandler);

appygram lets you add a user object to the trace it sends. It defaults to not sending a user object. To enable do

appygram.include_user = true;

It defaults to the location of req['user']. To change this do

appygram.user_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

appygram.app_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.

appygram.reset_to_default();

You can see some basic examples here.

Example app

Basic sendFeedback Method

  var appygram = require('appygram');
  appygram.setApiKey('api_key');
  appygram.sendFeedback({
   name:'Will',
   topic:'Feedback',
   message:'I am sending an appygram!',
   email:'w.laurance@gmail.com'
  }, function(){
    //done sending feedback
  });

Most of the options for the express route are available to this method with the exception of the include user option.

Something went wrong with that request. Please try again.