New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

heap-server

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

heap-server

Heap Analytics server-side events helper

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-54.55%
Maintainers
1
Weekly downloads
 
Created
Source

Heap server-side events Build Status

Heap Analytics server-side events helper

Getting Started

Install the module with: npm install heap-server

More info on the Heap documentation site

Methods

The Heap server side API currently has two internal methods:

  • track
  • identify

When you send along an event property with the heap.push() method you will be using the internal track method. If you are not sending an event along you're using the internal identify method.

Example: tracking a custom event
var heap = require('heap-server')('--your-heap-app-id--');

heap.push({
  identity: "john@doe.org",
  event: "Custom event name that shows up in Heap Analytics",
  properties: { // extra event properties are optional
    "foo" : "bar"
  }
}, function(err, foo){
  if(err){
    return;
  }
  console.log(foo);
});

// or no callback

heap.push({
  identity: "john@doe.org",
  event: "Custom event name that shows up in Heap Analytics",
  properties: {
    "foo" : "bar"
  }
});
Example: identifying a new or existing user

You can also use this to update properties for an existing user.

var heap = require('heap-server')('--your-heap-app-id--');

heap.push({
  identity: 'john@doe.orgfoobar',
  properties: {
    'foo': 'bar',
    'random': 'bogus'
  }
},
function(err, result){
    if(err){
      return;
    }
    console.log(result);
});


// or no callback

heap.push({
  identity: 'john@doe.orgfoobar',
  properties: {
    'foo': 'bar',
    'random': 'bogus'
  }
});

FAQs

Package last updated on 19 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc