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

# user_event

> Send custom events to the connected client on the call.

[browser-sdk]: /docs/browser-sdk/v3/js/reference/signalwire/client

[on-method]: /docs/browser-sdk/js/reference/video/room-session/on

Allows the user to set and send events to the connected client on the call. This is useful for triggering actions on the client side.
Commonly used with the [browser-sdk][browser-sdk].
Accepts an object mapping event names to values. The event object can be any valid JSON object.

An object that accepts the following properties.

## **Properties**

An object mapping event names to values. The event object can be any valid JSON object.

## **Event Object**

The `event` parameter can be any valid JSON object.
Any key-value pair in the object is sent to the client as an event type called: `user_event`.

The client can listen for these events using the [on-method][on-method].

## **Examples**

### Send a custom event to the client

```yaml
version: 1.0.0
sections:
  main:
    - user_event:
        event:
          myCustomEvent: 'Hello, world!'
    - play:
        url: 'say: Custom event sent.'
```

```json
{
  "version": "1.0.0",
  "sections": {
    "main": [
      {
        "user_event": {
          "event": {
            "myCustomEvent": "Hello, world!"
          }
        }
      },
      {
        "play": {
          "url": "say: Custom event sent."
        }
      }
    ]
  }
}
```

### Send multiple events with different payloads

```yaml
version: 1.0.0
sections:
  main:
    - user_event:
        event:
          eventA:
            foo: bar
          eventB:
            count: 42
            active: true
    - play:
        url: 'say: Multiple events sent.'
```

```json
{
  "version": "1.0.0",
  "sections": {
    "main": [
      {
        "user_event": {
          "event": {
            "eventA": {
              "foo": "bar"
            },
            "eventB": {
              "count": 42,
              "active": true
            }
          }
        }
      },
      {
        "play": {
          "url": "say: Multiple events sent."
        }
      }
    ]
  }
}
```