Realtime data

LiveKit includes powerful capabilities to exchange data between participants in realtime.

Overview

Most production applications require some amount of realtime data exchange, and some rely on it exclusively without using media tracks at all. You can pick the realtime data features that best fit your use case.

Data messages

The most flexible and powerful method of data exchange. Each participant can send any kind of binary data in small packets to one or more other participants. This feature uses WebRTC data channels under the hood.

Data messages can be sent at a very high frequency, but are delivered only to currently connected participants and are not persisted anywhere.

Get started with data messages

Participant attributes

Each participant has a string key-value store called attributes, and a free-form string field called metadata. These fields are stored and managed by the LiveKit server, and are automatically synchronized to new participants who join the room later.

Attributes and metadata are useful for sharing stateful information about each participant, but are not suitable for high-frequency updates (more than once every few seconds) due to sychronization overhead.

Get started with participant attributes

RPC

A participant can remotely execute a custom method on another participant and await a response. This is useful when a response or delivery confirmation is necessary for your application. AI Agent applications can use RPC to forward LLM function calls to the UI, fetch data that's available only within the frontend environment (e.g. geolocation), and more.

Get started with RPC

Room metadata

Each room has a free-form string field called metadata. Updates are automatically synchronized to all participants. Room metadata can only be changed using the server APIs and is not suitable for high-frequency updates.

Get started with room metadata