Session store is a shared realtime key-value store that is accessible by everyone in the 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.

To get an instance of HMSSessionStore class, You can add an event listener for ON_SESSION_STORE_AVAILABLE event on the HMSSDK instance

For example:

hmsInstance.addEventListener(HMSUpdateListenerActions.ON_SESSION_STORE_AVAILABLE, <your callback function>);

Checkout Session Store docs fore more details $https://www.100ms.live/docs/react-native/v2/how-to-guides/interact-with-room/room/session-store

Hierarchy

  • HMSSessionStore

Constructors

Methods

Constructors

Methods

  • This method registers a callback function for listening to value changes of a particular key. Registered Callback function will be called initially with latest value and whenever the value updates

    Type Parameters

    • T extends string[]

    Parameters

    • forKeys: T
    • callback: ((error, data) => void)
        • (error, data): void
        • Parameters

          • error: null | string
          • data: null | {
                key: T[number];
                value: JsonValue;
            }

          Returns void

    Returns {
        remove: (() => void);
    }

    subscription object

    • remove: (() => void)
        • (): void
        • Returns void

  • This method returns the value of any specified key on session store. Note that you will not get updates for any change in value of the specified key, It returns the latest value at the time it was called.

    To listen to value change updates use addKeyChangeListener method instead.

    Parameters

    • key: string

    Returns Promise<JsonValue>

  • 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.

    Parameters

    Returns Promise<{
        success: true;
    }>

Generated using TypeDoc