Socket
Socket
Sign inDemoInstall

amplitude

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

amplitude

A node wrapper for Amplitude analytics http api


Version published
Weekly downloads
23K
increased by8.35%
Maintainers
1
Weekly downloads
 
Created
Source

amplitude

Server side implimentation of Amplitude's http api.

Install

npm install amplitude --save

Initialization

var Amplitude = require('amplitude');
// Initialize with user id
var amplitude = new Amplitude('api-token', { user_id: 'some-user-id' });
// Or initialize with device id
var amplitude = new Amplitude('api-token', { device_id: 'some-device-id' });

Track an event

Pass in any keys listed on the Amplitude http api. The only required key is event_type.

var data = {
  event_type: "some value", // required
  event_properties: { 
    //... 
  },
  user_properties: { 
    //... 
  }
}
amplitude.track(data);

Track an event with an optional callback

amplitude.track(data, function(error, response){
  // If post was succesful, error will be null
  // Currently, the response returned from the amplitude api is an empty object
  //... do something
});

Keywords

FAQs

Package last updated on 03 Jul 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