Skip to main content

# WebSocketMessageListener

    type WebSocketMessageListener = (params: {
      eventName: string;
      eventOptions?: Record<string, unknown>;
      eventParams: WebSocketEventMessageInfo;
      obj: IWebSocket;
    }) => void;

Event handler for incoming WebSocket event messages.

Fired when a message matching a subscription's filter criteria is received.

## Parameters​

### params​

event parameters

#### eventName​

`string`

event name

#### eventOptions?​

`Record`<`string`, `unknown`>

additional options related to the event

#### eventParams​

`WebSocketEventMessageInfo`

the event message information including subscriptionId, resource, and payload

#### obj​

`IWebSocket`

websocket object reference

## Returns​

`void`