github pusher/pusher-http-node v4.0.0

latest releases: v5.1.1-beta, 5.1.1-beta, 5.1.0-beta...
4 years ago

[BREAKING CHANGE] Methods that previously took callbacks now return promises.

  • trigger, triggerBatch, get, and post return a promise which resolves
    to a Response (as provided by node-fetch),
    or rejects to a RequestError. Of particular note:
    • Response has a status where is used to have a statusCode.
    • RequestError has a status where is used to have a statusCode to
      mirror the above.
    • Response has
      json,
      text, etc to
      access the body where before it exposed body as a string.

[BREAKING CHANGE] The Pusher constructor no longer accepts proxy or keepAlive, but instead accepts agent.

const pusher = new Pusher.forURL(process.env.PUSHER_URL, {
  agent: new HttpsProxyAgent("http://localhost:8321"),
})
  • To configure keep alive:
const pusher = new Pusher.forURL(process.env.PUSHER_URL, {
  agent: new https.Agent({ keepAlive: true }),
})

[REMOVED] Specific Parse Cloud build. I don't believe it is required any more, but please open an issue if there are any problems using this release on Parse Cloud!

Don't miss a new pusher-http-node release

NewReleases is sending notifications on new releases.