***

title: swmlUserEvent
slug: /reference/typescript/agents/function-result/swml-user-event
description: Send a custom user event through SWML for real-time UI updates.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[functionresult]: /docs/server-sdks/reference/typescript/agents/function-result

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**

<ParamField path="eventData" type={"Record<string, unknown>"} required={true} toc={true}>
  Object containing the event payload. Include a `"type"` key to help
  clients distinguish between different event types.
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] -- `this`, for chaining.

## **Example**

```typescript {4}
import { FunctionResult } from '@signalwire/sdk';

const result = new FunctionResult()
  .swmlUserEvent({ type: 'order_placed', orderId: '12345' });
```