Javascript API Reference
    Preparing search index...

    Class realtimeStore

    Index

    Constructors

    Methods

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

      Throws an error if the key does not exist or the request fails.

      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>

      Throws an error if:

      • The key is invalid or missing.
      • The callback is not a function.
      • The subscription request fails.
      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>

      Throws an error if:

      • The key is missing or invalid.
      • The value is not a string or exceeds the allowed size (1 KB).
      • The request fails.
      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>

      Throws an error if the observer ID is invalid, not found, or if the unsubscribe operation fails.

      try {
      await meeting.realtimeStore.stopObserving(observerId);
      console.log("Stopped observing successfully!");
      } catch (error) {
      console.error("Failed to stop observing:", error);
      }