onConnect or onInterval hooks of the WebSocket V2 command.
Command Type
Command Type ID: 3Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| sendMessage | string | The message payload to send over the socket | Yes |
Usage Examples
Send Subscription Message on Connect
Used inside theonConnect hook of a WebSocket V2 command:
Send Periodic Heartbeat
Used inside anonInterval hook:
Related Commands
- WebSocket V2 - The parent command that provides the connection context
- WebSocket V2 Close - Close the connection after sending