Publish API: deprecated fire() method for JavaScript SDK

DeprecatedPublish is a current API. The fire() method is deprecated. New apps should use publish(). Go to Publish

This page documents the deprecated pubnub.fire() method of the PubNub JavaScript SDK. Publish is a current API, and only this method is deprecated. The method remains for apps that already call it. New apps call publish() with storeInHistory: false and replicate: false.

Fire​

Deprecated

fire() is deprecated in the JavaScript SDK. Use publish() with storeInHistory: false and replicate: false instead. The replicate parameter is itself deprecated in the SDK types.

fire() sends a message to Functions event handlers and Illuminate on the target channel. The handler can read the request body. Messages sent with fire() aren't replicated to subscribers and aren't stored in Message Persistence.

fire() takes the same parameters as publish(). The TypeScript signature promises a PublishResponse, but at runtime fire() resolves with undefined and discards request errors. Call publish() when you need the timetoken or the error.

Was this page useful?

Last updated on