Javascript API Reference
    Preparing search index...

    Class realtimeStore

    Index
      • This method can be used to retrieve the value associated with a given key.

      Parameters

      • key: string

        The key whose value should be retrieved.

      Returns Promise<string>

      A promise that resolves to the stored value.

      • Errorkey is missing
      • Errorkey is not a string
      • Error — the get request fails on the server
      try {
      const value = await meeting.realtimeStore.getValue("Blocked_Students");
      console.log("Current value:", value);
      } catch (error) {
      console.error("Failed to get data:", error);
      }
      • This method can be used to subscribe to real-time updates for a specific key.

      • The provided callback function is executed whenever the value associated with the key is updated by any participant.

      Parameters

      • key: string

        The key to observe for updates.

      • callback: Function

        A function that handles value updates along with the ID of the participant who made the change.

      Returns Promise<string>

      • Errorkey is missing
      • Errorkey is not a string
      • Errorcallback is not a function
      • Error — the underlying subscribe request fails on the server
      try {
      const observerId = await meeting.realtimeStore.observe(
      "Blocked_Students",
      (value, updatedBy) => {
      console.log("Value updated:", value, "by", updatedBy);
      }
      );
      } catch (error) {
      console.error("Failed to observe key:", error);
      }
      • This method can be used to store or update a value in the Realtime Store.

      • If the specified key already exists, its value is overwritten. Passing null as the value deletes the key from the store.

      Parameters

      • key: string

        A unique identifier used to store the value.

      • value: string

        The value to store. Pass null to delete the key.

      Returns Promise<void>

      • Errorkey is missing
      • Errorkey is not a string, or value is neither a string nor null
      • Errors.ERROR_PAYLOAD_TOO_LARGE — value payload exceeds the allowed size (1 KB)
      • Error — the set request fails on the server
      try {
      await meeting.realtimeStore.setValue("Blocked_Students", "[Halima, Rajan]");
      console.log("Data set successfully!");
      } catch (error) {
      console.error("Failed to set data:", error);
      }
      • This method can be used to stop receiving updates for a previously registered observer.

      Parameters

      • observerId: string

        The unique observer ID returned by the observe() method.

      Returns Promise<void>

      • ErrorobserverId is missing or was never returned by observe()
      • Error — the underlying unsubscribe request fails on the server
      try {
      await meeting.realtimeStore.stopObserving(observerId);
      console.log("Stopped observing successfully!");
      } catch (error) {
      console.error("Failed to stop observing:", error);
      }