swmlUserEvent

View as MarkdownOpen in Claude

Send a custom user event through SWML. Events are delivered to connected clients in real time, commonly used to drive UI updates in interactive applications (e.g., updating a scoreboard, dealing cards, showing status).

Parameters

eventData
Record<string, unknown>Required

Object containing the event payload. Include a "type" key to help clients distinguish between different event types.

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult()
4 .swmlUserEvent({ type: 'order_placed', orderId: '12345' });