@circulare/usage-tracker-node

0.0.2 • Public • Published

Introduction

Tracking library based on Mixpanel's SDK, focused on event tracking.

Getting Started

To start tracking events, first install the library via npm install --save @circulare/usage-tracker-node and import it and initialize it as follows:

const usageTrackerNode = require('usage-tracker-node');

const usageTracker = usageTrackerNode.init('TOKEN'); // Mixpanel's project token

The token passed to .init() is the project token on your Mixpanel account. More information on how to locate the project token can be found here.

Once the tracker is initialized and knows to which project to redirect the events, you can start tracking them by passing an event name and the properties you wish to track:

const usageTrackerNode = require('@circulare/usage-tracker-node');
const usageTracker = usageTrackerNode.init('TOKEN'); // Mixpanel's project token

usageTracker.track('List Users', {
  endpoint: '/users',
  requestedAt: 'timestamp',
  accountId: 'accountId',
});

Package Sidebar

Install

npm i @circulare/usage-tracker-node

Weekly Downloads

71

Version

0.0.2

License

UNLICENSED

Unpacked Size

3.99 kB

Total Files

8

Last publish

Collaborators

  • circulare-tech