0.0.3 • Published 8 years ago

localytics v0.0.3

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Localytics API wrapper.

  • Configurable from env variables or a source code
  • Returns a promise
  • Don't require external modules
  • Capable of using Keep-Alive connections

So far only Profiles API is implemented.

Installation

npm i localytics --save

Usage

Define API Keys LOCALYTICS_KEY and LOCALYTICS_SECRET. You can find them in your localitics profile.

Keys can be passed from env or as arguments when library is initialized:

var localytics = require('localytics')('MY_API_KEY', 'MY_API_SECRET');

or from shell, or Heroku Config Vars

export LOCALYTICS_KEY="MY_API_KEY"
export LOCALYTICS_SECRET="MY_API_SECRET"

Example

var localytics = require('localytics')();

localytics.setProfile('Bob', {
  "$first_name": 'Bob',
  favoriteNumber: 7,
  toDelete: null,
}).then(console.log).catch(console.log);

Promises

setProfile(id, data)

getProfile(id)

deleteProfile(id)

To Do