> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# 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<PubSubMessageContract toc={true}>` — 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.