You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Support fetching channel info on trigger
Adds support for a new experimental feature of the Channels API:
Specifically the ability to specify an `info` parameter in a
trigger body, or with an event in a batch trigger body. The server
will respond with attributes in the same format as the `/channels`
endpoint.
The `info` param is specified in a "params" object, which is
passed in as the fourth parameter to the `trigger` method. The
`socket_id` parameter is specified in the same way.
Note: this introduces a breaking change for users that were
passing in a `socket_id`.
It is not a breaking change for `triggerBatch`.
`triggerBatch` has also been updated to support `socket_id` being
included as part of event objects.
Copy file name to clipboardExpand all lines: README.md
+73-3Lines changed: 73 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -160,11 +160,81 @@ You can trigger a batch of up to 10 events.
160
160
161
161
### Excluding event recipients
162
162
163
-
In order to avoid the client that triggered the event from also receiving it, the `trigger` function takes an optional `socketId` parameter. For more informaiton see: <http://pusher.com/docs/publisher_api_guide/publisher_excluding_recipients>.
163
+
In order to avoid the client that triggered the event from also receiving it, a `socket_id` parameter can be added to the `params` object. For more information see: <http://pusher.com/docs/publisher_api_guide/publisher_excluding_recipients>.
* @param {String|String[]} channel list of at most 100 channels
131
131
* @param {String} event event name
132
132
* @param data event data, objects are JSON-encoded
133
-
* @param {String} [socketId] id of a socket that should not receive the event
133
+
* @param {Object} [params] additional optional request body parameters
134
+
* @param {String} [params.socket_id] id of a socket that should not receive the event
135
+
* @param {String} [params.info] a comma separate list of attributes to be returned in the response. Experimental, see https://pusher.com/docs/lab#experimental-program
0 commit comments