0.1.1 ā€¢ Published 3 years ago

electrolytic v0.1.1

Weekly downloads
24
License
SEE LICENSE IN LI...
Repository
-
Last release
3 years ago

Electrolytic

Electrolytic on NPM

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 and get your App key and Secret. It's free to get started! ā­ļø

Then do the thing, you know, the thing:

npm install --save electrolytic

Use it in your app!

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:

{
  "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

License

SOME RIGHTS RESERVED

See License