> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# my.onSocketClose

> Listen for WebSocket connection close events.

Register a callback for when the WebSocket connection closes.

## Parameters

| Property | Type     | Required | Description              |
| -------- | -------- | -------- | ------------------------ |
| callback | Function | Yes      | Handler for close events |

## Code Example

```javascript theme={null}
my.onSocketClose(() => {
  console.log('WebSocket disconnected');
});
```
