Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Updated readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
andywaite committed Sep 1, 2015
1 parent 48d5d7c commit 2d52c58
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,44 @@
# Simple node kissmetrics library
# Simple node KISSmetrics library

Simple wrapper for KISSmetrics client library written in ES6.

[![Build Status](https://travis-ci.org/silktide/simple-node-kissmetrics.svg?branch=master)](https://travis-ci.org/silktide/simple-node-kissmetrics)
[![Code Climate](https://codeclimate.com/repos/55df319a69568066780016d6/badges/d2a8873373061fa5face/gpa.svg)](https://codeclimate.com/repos/55df319a69568066780016d6/feed)
[![Code Climate](https://codeclimate.com/repos/55df319a69568066780016d6/badges/d2a8873373061fa5face/gpa.svg)](https://codeclimate.com/repos/55df319a69568066780016d6/feed)
[![Test Coverage](https://codeclimate.com/repos/55df319a69568066780016d6/badges/d2a8873373061fa5face/coverage.svg)](https://codeclimate.com/repos/55df319a69568066780016d6/coverage)

## Usage example

First, install the library.

npm install simple-node-kissmetrics --save

Using is as simple as importing the library and calling a couple of functions.

import kissmetrics from 'simple-node-kissmetrics';

function setupMyApp() {
// Must be called first to set the key for the library. This only needs to be called once to initialise the library.
kissmetrics.setKey(YOUR_API_KEY);
}

function trackSomething() {
// Track an event.
kissmetrics.trackEvent("An event", {"property": "value"});
}

function setUserProperty() {
// Track some user properties.
kissmetrics.setUserProperties({"email": "[email protected]"});
}

You can also import specific functions if you prefer.

import { setup as setupAnalytics, trackEvent } from 'simple-node-kissmetrics';

function setupMyApp() {
setupAnalytics();
}

function trackSomething() {
trackEvent("An event", {"property": "value"});
}

0 comments on commit 2d52c58

Please sign in to comment.