---
title: "vuer.events"
section: "Core"
order: 1600
description: "Python API reference for vuer.events"
---

# vuer.events

## Event

```python
class Event
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L9)

An event is a message sent from the server to the client.

```python
ts: float
```

## ClientEvent

```python
class ClientEvent(Event)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L30)

Event received from the client (browser).

Subclasses must define ``etype`` as a class attribute. For deserialization,
``etype`` is passed via kwargs and set via ``__dict__.update()``.

Example::

    class MyEvent(ClientEvent):
        etype = "MY_EVENT"

```python
etype: str
```

## ClientEvent.__init__

```python
def __init__(self, ts=None, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L49)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
value = None
```

## InitEvent

```python
class InitEvent(ClientEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L75)

### Inherited members

- `value` — from [`vuer.events.ClientEvent`](/python-api/events#clientevent)
- `__init__` — from [`vuer.events.ClientEvent`](/python-api/events#clientevent)
- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'Init'
```

## NullEvent

```python
class NullEvent(ClientEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L82)

### Inherited members

- `value` — from [`vuer.events.ClientEvent`](/python-api/events#clientevent)
- `__init__` — from [`vuer.events.ClientEvent`](/python-api/events#clientevent)
- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'NULL'
```

## ServerEvent

```python
class ServerEvent(Event)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L89)

Event sent from the server to the client (browser).

Subclasses must define ``etype`` as a class attribute. The ``__init__``
copies ``self.etype`` to the instance dict for serialization.

Example::

    class MyServerEvent(ServerEvent):
        etype = "MY_SERVER_EVENT"

        def __init__(self, data):
            super().__init__(data)

```python
etype: str
```

## ServerEvent.__init__

```python
def __init__(self, data, ts: float=None, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L107)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

## Noop

```python
class Noop(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L126)

## Noop.__init__

```python
def __init__(self, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L129)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'NOOP'
```

## Set

```python
class Set(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L136)

Set Operation (Server Event).

SET Operator is used exclusively to set the root Scene node. Throws an error (on the client side)
if the data is not a Scene object.

## Set.__init__

```python
def __init__(self, data: Scene)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L146)

:param data: The data to set.

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'SET'
```

## Update

```python
class Update(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L153)

UPDATE Operator is used to update a specific node in the scene graph.

Use "$delete" value for elements you want to remove. Or "$strict" mode to
copy the element verbatim.

Example:
    app.update @ &#123; "key": "my_key", "value": "$delete" &#125;

    app.update(&#123; "key": "my_key", "value": "$delete" &#125;, strict=True)

    app.update @ [ &#123; "key": "my_key", "value": "$delete" &#125;, ... ]

    app.update(&#123; "key": "my_key", "value": "$delete" &#125;, ...,  strict=True)

## Update.__init__

```python
def __init__(self, *elements: Element, strict=False)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L172)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'UPDATE'
```

## Add

```python
class Add(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L185)

ADD Operator is used to insert new nodes to the scene graph. By default, it
inserts into the root node, but you can specify a parent node to insert into
via the `to` argument.

Note: only supports a single parent key right timestamp.

Example:
    app.add @ Element(...)

    app.add @ [ Element(...), Element(...), ... ]

    app.add(Element, to="my_parent_key")

    app.add([Element, ...], to="my_parent_key")

## Add.__init__

```python
def __init__(self, *elements: List[Element], to: str=None)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L206)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'ADD'
```

## Upsert

```python
class Upsert(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L224)

UPSERT Operator is used to update nodes to new values, when then they do not
exist, insert new ones to the scene graph.

Note: only supports a single parent key right timestamp.

Example:
    app.upsert @ Element(...)

    app.upsert @ [ Element(...), Element(...), ... ]

    app.upsert(Element, to="my_parent_key")

    app.upsert([Element, ...], to="my_parent_key")

## Upsert.__init__

```python
def __init__(self, *elements: List[Element], to: str=None, strict=False)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L244)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'UPSERT'
```

## Remove

```python
class Remove(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L263)

An Update ServerEvent is sent to the client when the server wants to update the client's state.
It appends the data sent in the Update ServerEvent to the client's current state.

## Remove.__init__

```python
def __init__(self, *keys: List[str], **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L271)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'REMOVE'
```

## HapticActuatorPulse

```python
class HapticActuatorPulse(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L276)

Haptic Actuator Pulse event to trigger haptic feedback on the client side.

## HapticActuatorPulse.__init__

```python
def __init__(self, left: Optional[TypedDict('ActuatorData', {'strength': float, 'duration': float})]=None, right: Optional[TypedDict('ActuatorData', {'strength': float, 'duration': float})]=None, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L283)

Haptic Actuator Pulse event to trigger haptic feedback on the client side.

:param left: Optional dictionary with 'strength' and 'duration' for left actuator.
:param right: Optional dictionary with 'strength' and 'duration' for right actuator.
:param kwargs: Additional keyword arguments.

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'HAPTIC_ACTUATOR_PULSE'
```

## Frame

```python
class Frame(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L304)

A higher-level ServerEvent that wraps other ServerEvents

```python
ServerEvent: ServerEvent
```

## Frame.__init__

```python
def __init__(self, data: ServerEvent, frame_rate=60.0, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L312)

Frame object returns a NOOP client event, to keep the on_socket generator
running at a constant rate.

:param data:
:param frame_rate: default to 60, set this for wait time between frames
:param kwargs:

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'FRAME'
```

## End

```python
class End(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L324)

A higher-level ServerEvent that wraps other ServerEvents

## End.__init__

```python
def __init__(self, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L331)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'TERMINATE'
```

## ServerRPC

```python
class ServerRPC(ServerEvent)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L338)

```python
uuid: str
```

## ServerRPC.__init__

```python
def __init__(self, data, uuid=None, **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L345)

### Inherited members

- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'RPC'
```

```python
rtype = 'RPC_RESPONSE@{uuid}'
```

## GrabRender

```python
class GrabRender(ServerRPC)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L350)

A higher-level ServerEvent that wraps other ServerEvents

## GrabRender.__init__

```python
def __init__(self, *, key: str='DEFAULT', **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L357)

### Inherited members

- `uuid` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `rtype` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'GRAB_RENDER'
```

## MjStep

```python
class MjStep(ServerRPC)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L363)

A higher-level ServerEvent that wraps other ServerEvents

## MjStep.__init__

```python
def __init__(self, *, key: str='DEFAULT', **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L370)

### Inherited members

- `uuid` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `rtype` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'MJ_STEP'
```

## MjRender

```python
class MjRender(ServerRPC)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L376)

A higher-level ServerEvent that wraps other ServerEvents

## MjRender.__init__

```python
def __init__(self, *, key: str='DEFAULT', **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L383)

### Inherited members

- `uuid` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `rtype` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'MJ_RENDER'
```

## GetWebXRMesh

```python
class GetWebXRMesh(ServerRPC)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L389)

Request WebXR mesh data from the client.

This RPC event is used to request real-world mesh detection data
from WebXR AR sessions. The client will respond with mesh data
including vertices, indices, semantic labels, and transformation matrices.

Example Usage::

    # Request mesh data from the client
    mesh_data = await session.get_webxr_mesh(key="webxr-mesh")

    # Access the mesh data
    for mesh in mesh_data.value['meshes']:
        vertices = mesh['vertices']
        indices = mesh['indices']
        semantic_label = mesh.get('semanticLabel')
        matrix = mesh['matrix']

:param key: The key of the WebXRMesh component to query (default: "webxr-mesh")
:param kwargs: Additional keyword arguments

## GetWebXRMesh.__init__

```python
def __init__(self, *, key: str='webxr-mesh', **kwargs)
```

[Source](https://github.com/vuer-ai/vuer-docs/blob/main/src/vuer/events.py#L415)

### Inherited members

- `uuid` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `rtype` — from [`vuer.events.ServerRPC`](/python-api/events#serverrpc)
- `ts` — from [`vuer.events.Event`](/python-api/events#event)

```python
etype = 'GET_WEBXR_MESH'
```

## Public imports

These symbols are available from this module. Their definitions are documented in the linked modules.

- [`Element`](/python-api/schemas/html_components#element) — `vuer.schemas.html_components.Element`
- [`Scene`](/python-api/schemas/scene_components#scene) — `vuer.schemas.scene_components.Scene`
- [`serializer`](/python-api/serdes#serializer) — `vuer.serdes.serializer`
