0.0.3 • Published 4 years ago

saweria-eventsource v0.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Saweria Eventsource

Simple EventSource wrapper for Saweria.co donation alert.

Example

const SaweriaEventSource = require("saweria-eventsource");

const client = new SaweriaEventSource("your-stream-key");

client.on("donation", (donation) => {
    console.log(donation);
})

How to get your stream key

  1. Go to https://saweria.co/overlays (logged in)
  2. Open Alert Dukungan
  3. Get the stream key from the url, it should look like this:
https://saweria.co/overlays/alert?streamKey=[your-stream-key]&noBorder=true&template=...

Emitted Donation Object Example

{
  amount: '69420',
  donator: 'Someguy',
  media: {
    src: [
      'https://media2.giphy.com/media/gw3IWyGkC0rsazTi/giphy.webp',
      'https://media2.giphy.com/media/gw3IWyGkC0rsazTi/giphy.mp4',
      'https://media2.giphy.com/media/gw3IWyGkC0rsazTi/giphy.gif'
    ],
    tag: 'picture'
  },
  message: 'THIS IS A FAKE MESSAGE! HAVE A GOOD ONE',
  sound: {
    '1547679809default.ogg': 'https://saweria-space.sgp1.cdn.digitaloceanspaces.com/prd/sound/836d7a85-dd70-4028-85fb-00fd785f0928-c527b4f6bd6282e21e78c85343d496fa.ogg'
  }
}
0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago