> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # Events The PubSub.Client object emits the events listed below. You can work with these events using the following methods: #### [on](/docs/browser-sdk/v3/js/reference/pubsub/client/on) Subscribe to an event #### [once](/docs/browser-sdk/v3/js/reference/pubsub/client/once) Subscribe to an event once #### [off](/docs/browser-sdk/v3/js/reference/pubsub/client/off) Unsubscribe from an event #### [removeAllListeners](/docs/browser-sdk/v3/js/reference/pubsub/client/remove-all-listeners) Remove all event listeners ## Events ### message * **message**(`message`) A new message has been received. #### Properties **`message`** `PubSubMessage` — required The received message. See [`PubSubMessage`](/docs/browser-sdk/v3/js/reference/pubsub) for more details. --- --- ### session.expiring * **session.expiring**() The session is going to expire. Use the [updateToken](/docs/browser-sdk/v3/js/reference/pubsub/client/update-token) method to refresh your token.