> ## 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.onSocketOpen

> Listen for WebSocket connection open events.

Register a callback for when the WebSocket connection is established.

## Parameters

| Property | Type     | Required | Description                 |
| -------- | -------- | -------- | --------------------------- |
| callback | Function | Yes      | Handler for connection open |

## Code Example

```javascript theme={null}
my.onSocketOpen(() => {
  console.log('WebSocket connected');
  my.sendSocketMessage({ data: 'Hello server' });
});
```
