Realtime Store - Android
The Realtime Store allows you to store, update, retrieve, and observe custom key-value data within a meeting — in real time. It acts as a shared data layer across all connected participants, ensuring synchronized states throughout the session.
This is particularly useful for collaborative or stateful meeting experiences such as:
- Pinned messages and flags
- Moderation data (e.g., blocked users)
- Collaborative notes or polls
set()
The set() method is used to store or update data in the RealtimeStore. If a key already exists, it will be overwritten with the new value. Passing null as the value deletes the key.
Key Notes
- Supports String values only.
- Each key can store up to 1 KB of data.
- A maximum of 100 keys are allowed per session.
- Deletion is performed by setting the value to
null. - Throws an error if:
- The key is missing or empty.
- The request fails.
- The session exceeds the 100-key limit.
Parameters
-
key(String)
The unique key to store the data under. -
value(String?)
The string value to be stored. Passnullto delete the key. -
callback(RealtimeStoreCallback<String>)
The callback will triggeronSuccess()oronError()withStringtype.
Example
- Kotlin
- Java
meeting.realtimeStore.set("YOUR_KEY", message, object : RealtimeStoreCallback<String> {
override fun onSuccess(value: String) {
Log.d("VideoSDK", "Value: $value")
}
override fun onError(error: String) {
Log.e("VideoSDK", "Error: $error")
}
})
meeting.realtimeStore.set("YOUR_KEY", message, new RealtimeStoreCallback<String>() {
@Override
public void onSuccess(String value) {
Log.d("VideoSDK", "Value: " + value);
}
@Override
public void onError(String error) {
Log.e("VideoSDK", "Error: " + error);
}
});
get()
The get() method retrieves the current value associated with a given key.
Key Notes
- Returns the current string value for the given key.
- Useful for fetching shared state when joining a meeting or reloading a view.
- Throws an error if the key is missing/empty or if the request fails.
Parameters
-
key(String)
The key whose value you want to retrieve. -
callback(RealtimeStoreCallback<String>)
The callback will triggeronSuccessoronErrorwithStringtype.
Example
- Kotlin
- Java
meeting.realtimeStore.get("YOUR_KEY", object : RealtimeStoreCallback<String> {
override fun onSuccess(value: String) {
Log.d("VideoSDK", "Value: $value")
}
override fun onError(error: String) {
Log.e("VideoSDK", "Error: $error")
}
})
meeting.realtimeStore.get("YOUR_KEY", new RealtimeStoreCallback<String>() {
@Override
public void onSuccess(String value) {
Log.d("VideoSDK", "value: " + value);
}
@Override
public void onError(String error) {
Log.e("VideoSDK", "Error: " + error);
}
});
observe()
The observe() method subscribes to real-time updates for a given key. When the key’s value changes, a delegate method on your listener is automatically triggered for all connected participants.
Key Notes
- You register a listener object that conforms to the
RealtimeStoreListenerprotocol. - The delegate method receives the new value and information about who updated it.
- Ideal for syncing live data like timers, shared notes, or agendas.
Parameters
-
key(String)
The key to observe. -
callback(RealtimeStoreListener<String>)
The callback will triggeronValueChangedwithStringnewValue andParticipantwho updated the value.
Example
- Kotlin
- Java
val realtimeStoreListener = object : RealtimeStoreListener {
override fun onValueChanged(newValue: String, updatedBy: Participant?) {
Log.d("VideoSDK", "onValueChange: Received update from: ${updatedBy.displayName}")
Log.d("VideoSDK", "onValueChange: Received update from: ${updatedBy.id}")
Log.d("VideoSDK", "onValueChange: New Value -> $newValue")
}
}
meeting.realtimeStore.observe(KEY_CHAT_HISTORY, realtimeStoreListener!!)
private RealtimeStoreListener realtimeStoreListener;
realtimeStoreListener = new RealtimeStoreListener() {
@Override
public void onValueChanged(String newValue, Participant updatedBy) {
Log.d("VideoSDK", "onValueChange: Received update from: " + updatedBy.getDisplayName());
Log.d("VideoSDK", "onValueChange: Received update from: " + updatedBy.getId());
Log.d("VideoSDK", "onValueChange: New Value -> " + newValue);
}
};
meeting.realtimeStore.observe(KEY_CHAT_HISTORY, realtimeStoreListener);
stopObserving()
Stops receiving updates for a specific key and listener combination.
Key Notes
- Should be called when the listener is no longer needed (e.g., when the view/ui controller is deallocated).
Parameters
-
key(String)
The key you want to stop observing. -
callback(RealtimeStoreListener<String>)
The callback/listener will be removed from list of listeners
Example
- Kotlin
- Java
meeting.realtimeStore.stopObserving("YOUR_KEY", realtimeStoreListener)
meeting.realtimeStore.stopObserving("YOUR_KEY", realtimeStoreListener);
Error Handling & Constraints
| Property | Description |
|---|---|
| Error Handling | All errors will be handled in onError() callback. |
| Payload Size | Maximum 1 KB per key. |
| Supported Type | Only String values are supported. Use null to delete key. |
| Concurrency | The latest write overwrites previous values (last write wins) |
| Key Limit | A maximum of 100 keys are allowed in a single session. |
Got a Question? Ask us on discord

