# localytics

> Localytics API wrapper

Latest version **0.0.3** (published 2015-11-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install localytics
pnpm add localytics
yarn add localytics
bun add localytics
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2015-11-12 |
| First published | 2015-11-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | meehow |
| Maintainers | meehow |
| Keywords | localytics, api, iPhone, iOS, Android, push, notification |

## Links

- npm: https://www.npmjs.com/package/localytics
- Repository: https://github.com/meehow/node-localytics
- Homepage: https://github.com/meehow/node-localytics#readme
- Issues: https://github.com/meehow/node-localytics/issues
- npm.io page: https://npm.io/package/localytics

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2015-11-12
- 0.0.2 — 2015-11-11
- 0.0.1 — 2015-11-06

## README

[Localytics](http://docs.localytics.com/#Dev/api-title.html) 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)

---
_Source: https://npm.io/package/localytics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
