index.js
function createEventSource(webhook, options)
{
  var self = this

  var eventSource = new EventSource(webhook, options)

  eventSource.addEventListener('open', this.emit.bind(this, 'open', webhook))
  eventSource.addEventListener('message', function(message)
  {
    self.push(message.data)
  })

  return eventSource
}
function createEventSource(webhook, options)
{
  var self = this

  var eventSource = new EventSource(webhook, options)

  eventSource.addEventListener('open', this.emit.bind(this, 'open', webhook))
  eventSource.addEventListener('message', function(message)
  {
    self.push(message.data)
  })

  return eventSource
}
function createEventSource ( webhook , options ) { var self = this var eventSource = new EventSource ( webhook , options ) eventSource . addEventListener ( 'open' , this . emit . bind ( this , 'open' , webhook ) ) eventSource . addEventListener ( 'message' , function ( message ) { self . push ( message . data ) } ) return eventSource }
Connect to a remove SSE server to receive the webhook notifications

@param {string} webhook
@param {Object} [options]
@param {Boolean} [options.withCredentials=false]

@return {EventSource}
Connect to a remove SSE server to receive the webhook notifications