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

# vuer.events

## Event

```python
class Event
```

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

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/docs/v0.0.71/src/vuer/events.py#L31)

## ClientEvent.__init__

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

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

### 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/docs/v0.0.71/src/vuer/events.py#L56)

## InitEvent.__init__

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

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

### Inherited members

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

## NullEvent

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

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

## NullEvent.__init__

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

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

### Inherited members

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

## ServerEvent

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

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

## ServerEvent.__init__

```python
def __init__(self, data, etype=None, ts: Union[Datetime, Timedelta]=None, **kwargs)
```

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

### 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/docs/v0.0.71/src/vuer/events.py#L94)

## Noop.__init__

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

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

### 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/docs/v0.0.71/src/vuer/events.py#L104)

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/docs/v0.0.71/src/vuer/events.py#L114)

: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/docs/v0.0.71/src/vuer/events.py#L121)

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/docs/v0.0.71/src/vuer/events.py#L140)

### 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/docs/v0.0.71/src/vuer/events.py#L153)

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/docs/v0.0.71/src/vuer/events.py#L174)

### 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/docs/v0.0.71/src/vuer/events.py#L192)

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/docs/v0.0.71/src/vuer/events.py#L212)

### 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/docs/v0.0.71/src/vuer/events.py#L231)

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/docs/v0.0.71/src/vuer/events.py#L239)

### 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/docs/v0.0.71/src/vuer/events.py#L244)

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/docs/v0.0.71/src/vuer/events.py#L251)

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/docs/v0.0.71/src/vuer/events.py#L272)

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/docs/v0.0.71/src/vuer/events.py#L280)

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/docs/v0.0.71/src/vuer/events.py#L292)

A higher-level ServerEvent that wraps other ServerEvents

## End.__init__

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

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

### 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/docs/v0.0.71/src/vuer/events.py#L306)

```python
uuid: str
```

## ServerRPC.__init__

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

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

### 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/docs/v0.0.71/src/vuer/events.py#L318)

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/docs/v0.0.71/src/vuer/events.py#L325)

### 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/docs/v0.0.71/src/vuer/events.py#L331)

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/docs/v0.0.71/src/vuer/events.py#L338)

### 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/docs/v0.0.71/src/vuer/events.py#L344)

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/docs/v0.0.71/src/vuer/events.py#L351)

### 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/docs/v0.0.71/src/vuer/events.py#L357)

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/docs/v0.0.71/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 = '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`
