Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created June 25, 2020 11:48
Show Gist options
  • Save velotiotech/6f5b0f6407c0a74a0bce4b398a849410 to your computer and use it in GitHub Desktop.
Save velotiotech/6f5b0f6407c0a74a0bce4b398a849410 to your computer and use it in GitHub Desktop.
Snippet from node app
var Pusher = require('pusher');
var pusher = new Pusher({
appId: 'APP_ID',
key: 'APP_KEY',
secret: 'APP_SECRET',
cluster: 'APP_CLUSTER'
});
// Logic which will then trigger events to a channel
function trigger(){
...
...
pusher.trigger('my-channel', 'my-event', {"message": "hello world"});
...
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment