Registers a callback to listen for changes to specified keys in the session store. The callback is called with the initial value and again whenever any value changes.
An array of keys to listen for changes on.
The function to call when a value changes.
An object with a remove
method to unregister the listener.
Retrieves the value for a given key from the session store. This method does not subscribe to changes; it only returns the current value at the time of the call.
To listen to value change updates use addKeyChangeListener
method instead.
The key whose value is to be retrieved.
A promise that resolves with the value of the key.
This method sets a value for a specific key on session store. Once a value is assigned, it will be available for other peers in the room who are listening for changes in value for that specific key.
The value to set, which can be any JSON-compatible type.
The key under which to store the value.
A promise that resolves when the operation is complete.
Generated using TypeDoc
Session store is a shared realtime key-value store that is accessible by all Peers in a Room. It can be utilized to implement features such as pinned text, spotlight (which brings a particular peer to the center stage for everyone in the room) and more, enhancing interactive experiences.
To get an instance of
HMSSessionStore
class, You can add an event listener forON_SESSION_STORE_AVAILABLE
event on theHMSSDK
instanceFor example:
Checkout Session Store docs fore more details $https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store