Ditto JS SDK v5.0.0
    Preparing search index...

    Class SmallPeerInfo

    The entrypoint for small peer user info collection. Small peer info consists of information gathered into a system collection on a regular interval and optionally synced to the Big Peer for device dashboard and debugging purposes.

    An instance of this class is available on each Ditto instance via its smallPeerInfo property. Instantiating this class directly is not supported.

    Index

    Accessors

    • get isEnabled(): boolean

      Indicates whether small peer info collection is currently enabled, defaults to true.

      Note: whether the background ingestion process is enabled or not is a separate decision to whether this information is allowed to sync to other peers (including the big peer). That is controlled by sync scopes, see Ditto's online documentation for details on how to configure them.

      Returns boolean

    • set isEnabled(newValue: boolean): void

      Set whether small peer info collection is enabled.

      Parameters

      • newValue: boolean

      Returns void

      when set to a non-boolean value.

    • get metadata(): Record<string, any>

      The metadata associated with the small peer info.

      Small peer info metadata is a free-form, user-provided JSON object that is inserted into the small peer info system document at each collection interval.

      Returns Record<string, any>

    • set metadata(metadata: Record<string, any>): void

      Set the metadata associated with the small peer info.

      The metadata must be a JSON-serializable object that conforms to the following constraints:

      • Must be a JSON object (not an array, string, number, etc.)
      • The size when encoded as JSON must be less than 128 KB
      • May only be nested up to 64 levels deep

      Parameters

      • metadata: Record<string, any>

      Returns void

      ditto.smallPeerInfo.metadata = {
      "foo": "bar",
      "nested": {
      "inner": "value"
      }
      }

      when set to a value that violates any of the constraints listed above.

    • get metadataJSONString(): string

      The metadata associated with the small peer info, as a JSON string.

      Returns string

    • set metadataJSONString(metadata: string): void

      Set the metadata associated with the small peer info, as a JSON string.

      Parameters

      • metadata: string

      Returns void

      metadata for more information on valid values.

      when set to a value that violates any of the constraints listed in metadata.