# instapush

> Instapush API client for Node.js

Latest version **0.0.7** (published 2014-02-06) · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.7 |
| Published | 2014-02-06 |
| First published | 2013-12-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.8 |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| Author | Instapush Team |
| Maintainers | pushbots |
| Keywords | Instapush, api, client |

## Links

- npm: https://www.npmjs.com/package/instapush
- npm.io page: https://npm.io/package/instapush

## Dependencies (1)

- [request](https://npm.io/package/request.md) ~2.12.0

## 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.7 (latest) — 2014-02-06
- 0.0.6 — 2014-02-05
- 0.0.5 — 2014-02-05
- 0.0.4 — 2014-01-25
- 0.0.3 — 2014-01-14
- 0.0.2 — 2014-01-14
- 0.0.1 — 2013-12-06

## README

## Instapush
### [Instapush](http://instapush.im) API client for Node.js

### Installation
```bash
npm install instapush
```

### Basic Use
```javascript
var instapush = require('instapush');
//authorize
instapush.settings({
    token: '5295f58f12e23cf5',
    id:'52eed96ea2a8f0f',
    secret:'9a96794fec44481de5',
});

instapush.request('GET','/apps/list' ,function (err, response){
    console.log(response);
});

```


### Helper Methods
The instapush module also includes methods that make working with common API resources a bit simpler:

<table width="100%">
    <tr>
        <th width="20%">Method</td>
        <th width="75%">Example</td>
        <th width="5%"></td>
    </tr>
     <tr>
        <td>notify</td>
        <td><pre lang="javascript"><code>instapush.notify(data,callback);</code></pre></td>
        <td><a href="https://instapush.im/developer/rest#send">Link</a></td>
    </tr>

    <tr>
        <td>listEvents</td>
        <td><pre lang="javascript"><code>instapush.listEvents(callback);</code></pre></td>
        <td><a href="https://instapush.im/developer/rest#listevents">Link</a></td>
    </tr>
    <tr>
        <td>listApps</td>
        <td><pre lang="javascript"><code>instapush.listApps(callback);</code></pre></td>
        <td><a href="http://instapush.im/developer/rest#listapps">Link</a></td>
    </tr>
    <tr>
        <td>addApp</td>
        <td><pre lang="javascript"><code>instapush.addApp(data,callback);</code></pre></td>
        <td><a href="http://instapush.im/developer/rest#addapp">Link</a></td>
    </tr>
    <tr>
        <td>addEvent</td>
        <td><pre lang="javascript"><code>instapush.addEvent(data, callback);</code></pre></td>
        <td><a href="http://instapush.im/developer/rest#stats">Link</a></td>
    </tr>
</table>

### Full Use
```javascript

var instapush = require('instapush');
//authorize
instapush.settings({
    ssl : true,
    token:'5295f58e23cf5',
    id:'52a221ab1284567',
    secret:'ad50d9eda8fdbc4b9a6',
});

//send a push notification triggered with the search event
instapush.notify({"event":"search","trackers":{"term":"api"}} ,function (err, response){
    console.log(response);
});

//list all events for the app, using the id and secret
instapush.listEvents(function (err, response){
    console.log(response);
});
//list all apps for a user using user token
instapush.listApps(function (err, response){
    console.log(response);
});


//adding a new event to an application
data = {"title":"nodejsEvent2",
        "trackers":["name","country"],
        "message":"{name} from {country} sucked."
        };
instapush.addEvent(data,function (err, response){
    console.log(response);
});

instapush.addApp({"title":"NodeJSAPP"},function (err, response){
    console.log(response);
});
```

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