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

    Type Alias Peer

    Represents a peer in a Ditto mesh network.

    type Peer = {
        connections: Connection[];
        deviceName: string;
        dittoSdkVersion?: string;
        identityServiceMetadata: Record<string, any>;
        isCompatible?: boolean;
        isConnectedToDittoServer: boolean;
        os?: PeerOS;
        peerKey: string;
        peerMetadata: Record<string, any>;
    }
    Index

    Properties

    connections: Connection[]

    Currently active connections of the peer.

    deviceName: string

    The human-readable device name of the peer. This defaults to the hostname but can be manually set by the application developer of the other peer. It is not necessarily unique.

    dittoSdkVersion?: string

    The Ditto SDK version the peer is running with, undefined if (yet) unknown.

    identityServiceMetadata: Record<string, any>

    Metadata associated with the peer by the identity service.

    Use an authentication webhook to set this value. See Ditto's online documentation for more information on how to configure an authentication webhook.

    isCompatible?: boolean

    Indicates whether the peer is compatible with the local peer. May be undefined if compatibility is not yet determined.

    isConnectedToDittoServer: boolean

    Indicates whether the peer is connected to Ditto Cloud.

    This field was called isConnectedToDittoCloud in SDK versions prior to 5.0.0.

    os?: PeerOS

    The operating system the peer is running on, undefined if (yet) unknown.

    peerKey: string

    The peer key is a unique identifier for a given peer, equal to or derived from the cryptographic public key used to authenticate it.

    NOTE: This will be empty when a peer is not updated to the latest version of the SDK.

    peerMetadata: Record<string, any>

    Metadata associated with the peer, empty dictionary by default.

    Use ditto.presence.setPeerMetadata() or ditto.presence.setPeerMetadataJSONData() to set this value.

    Peer metadata is dynamic and may change over the lifecycle of the presence graph. Specifically, it may be empty when a peer initially appears in the graph and will be updated once the peer has synced its metadata with the local peer.

    ditto.presence.peerMetadata for details on usage of metadata.