https://github.com/meehow/node-localytics
Localytics API wrapper
https://github.com/meehow/node-localytics
Last synced: 11 months ago
JSON representation
Localytics API wrapper
- Host: GitHub
- URL: https://github.com/meehow/node-localytics
- Owner: meehow
- Created: 2015-11-05T23:40:07.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-11-13T21:39:30.000Z (over 10 years ago)
- Last Synced: 2025-06-18T10:07:03.134Z (about 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[Localytics](http://www.localytics.com/) 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](http://docs.localytics.com/index.html#Dev/Profiles/api.html)
is implemented.
Installation
============
`npm i localytics --save`
Usage
=====
Define API Keys `LOCALYTICS_KEY` and `LOCALYTICS_SECRET`. You can find them in your
[localitics profile](https://dashboard.localytics.com/settings/apikeys).
Keys can be passed from env or as arguments when library is initialized:
```javascript
var localytics = require('localytics')('MY_API_KEY', 'MY_API_SECRET');
```
or from shell, or [Heroku Config Vars](https://devcenter.heroku.com/articles/config-vars)
```bash
export LOCALYTICS_KEY="MY_API_KEY"
export LOCALYTICS_SECRET="MY_API_SECRET"
```
Example
=======
```javascript
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
=====
- Add [Push API](http://docs.localytics.com/index.html#Dev/transactional-push.html)
- Add [Query API](http://docs.localytics.com/index.html#Dev/query-api.html)