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

> Send data through a WebSocket connection.

Send a message through an active WebSocket connection.

## Parameters

| Property | Type     | Required | Description                                                                                                           |
| -------- | -------- | -------- | --------------------------------------------------------------------------------------------------------------------- |
| data     | String   | Yes      | The data to be sent, in text string or base64 encoded string.                                                         |
| isBuffer | Boolean  | No       | If true, the data field represents base64 encoded binary strings. If empty, the data field represents normal strings. |
| success  | Function | No       | Callback on success                                                                                                   |
| fail     | Function | No       | Callback on failure                                                                                                   |
| complete | Function | No       | Callback that always executes                                                                                         |

## Code Example

```javascript theme={null}
my.sendSocketMessage({
  data: JSON.stringify({ action: 'ping' }),
  success: () => {
    console.log('Message sent');
  }
});
```
