Peer: {
    address: Address;
    connections: Connection[];
    deviceName: string;
    dittoSDKVersion?: string;
    identityServiceMetadata: Record<string, any>;
    isConnectedToDittoCloud: boolean;
    os?: string;
    peerKey: Uint8Array;
    peerKeyString: string;
    peerMetadata: Record<string, any>;
}

An instance of Ditto taking part in the Ditto mesh network.

Type declaration

  • address: Address

    Address to contact this peer via Ditto Bus, unique with a Ditto mesh network.

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

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

  • isConnectedToDittoCloud: boolean

    Indicates whether the peer is connected to Ditto Cloud.

  • Optional os?: string

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

  • peerKey: Uint8Array

    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 be empty when a peer is not updated to the latest version of the SDK.

    Deprecated

    Use peerKeyString instead.

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

    This will be empty when a peer is only connected via a WebSocket connection.

    See

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