# electrolytic

> Analytics, remote config and push notifications for Electron apps

Latest version **0.1.1** (published 2021-03-07) · SEE LICENSE IN LICENSE.md license · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2021-03-07 |
| First published | 2019-11-30 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE.md |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 11.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | moinism |
| Keywords | electron, push, notification, analytics, remote config, cloud config |

## Links

- npm: https://www.npmjs.com/package/electrolytic
- Homepage: https://electrolytic.app
- Issues: https://github.com/electrolytic/electrolytic/issues
- npm.io page: https://npm.io/package/electrolytic

## Alternatives

- [update-check](https://npm.io/package/update-check.md) — 4.0M weekly downloads
- [react-native-onesignal](https://npm.io/package/react-native-onesignal.md) — 134.5K weekly downloads
- [react-redux-toastr](https://npm.io/package/react-redux-toastr.md) — 33.7K weekly downloads
- [@nocobase/plugin-notification-manager](https://npm.io/package/@nocobase/plugin-notification-manager.md) — 2.0K weekly downloads
- [react-simple-toasts](https://npm.io/package/react-simple-toasts.md) — 1.9K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2021-03-07
- 0.1.0 — 2021-02-13
- 0.0.3 — 2019-12-08
- 0.0.2 — 2019-12-01
- 0.0.1 — 2019-11-30

## README

# Electrolytic

![Electrolytic on NPM](https://img.shields.io/npm/v/electrolytic?color=green&label=Electrolytic%20on%20NPM&logo=Electrolytic%20on%20NPM&style=for-the-badge)

A suite of features to make your desktop apps even more powerful 💪

- 🔎 **Analytics**; how many users, what platforms, where're they from?
- ☁️ **Cloud config**; JSON object that you can change via our dashboard and your app can access via this package, instantly.
- ⚡️ **Push notifications**; send silent (or loud) information from your servers to your app and users.

... and much more for electron apps.

This package is:

- 🚀 **Lightweight** (under 10KB gzipped). Yes, we're aware of and fully relate to the memes about the size of `node_modules` 😂
- 👌 is **not dependent** on any other package, only core code. We wrote every bit of it ourselves. No threat of package compromise!
- 🏎 **Performant**. It uses the bare-minimum resources to keep your app running faster. Not a memory hog.
- 🔐 **Privacy-respecting**. It only collects and sends the data to our servers when you tell it to. Respecting your app's and its users' privacy.

### Install it (please 🙏)

Sign up (also please) on [electrolytic.app](https://electrolytic.app) and get your `App key` and `Secret`. It's free to get started! ⭐️

Then do the thing, you know, ***the thing***:

```shell
npm install --save electrolytic
```

### Use it in your app!

```javascript
const Electrolytic = require('electrolytic')

const electrolytic = Electrolytic({
  appKey: '<Your-App-Key>',
})

// when app starts
electrolytic.on('token', (token) => {
  // send this token to your server, you'll need it to send a push
  console.log('user token', token);
})

// when you use that <token> to send push via server POST
electrolytic.on('push', (payload) => {
  console.log('got push notification', payload) // hola, here's a push!
})

// when you update the config on our dashboard. It's pushed to all the apps in realtime 🙀
electrolytic.on('config', (updatedConfig) => {
  console.log('look ma, updated config!', updatedConfig)
})
```

### Sending a push (and ❤️) from your server

Simply send a `POST` request to `https://api.electrolytic.app/push/send`

with JSON body having following schema:

```javascript
{
  "appKey": "<You-App-Key>",
  "appSecret": "<Your-App-Secret>",
  "target": ["<token>"], // should be an array. multiple tokens can be used to send the same push to all of them.
  "payload": "hola, here's a push!" // can also be a JSON object
}
```

❤️ is optional... well, I mean its not required.. Don't send it, seriously.

#### For more informations (and emojis), visit [electrolytic.app](https://electrolytic.app)
### License

SOME RIGHTS RESERVED

See [License](https://github.com/electrolytic/electrolytic/blob/master/LICENSE.md)

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