Contains information about a remote peer that has requested a connection.

Connection requests and their authorization are scoped to a specific Ditto peer and connection type.

Constructors

Accessors

  • get connectionType(): ConnectionType
  • The network transport of this connection request.

    Expect to receive separate connection requests for each network transport that connects the local and remote peer.

    Returns ConnectionType

  • get identityServiceMetadata(): Record<string, any>
  • Metadata for the remote peer that is provided 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.

    Convenience property that wraps identityServiceMetadataJSONString.

    Returns Record<string, any>

  • get identityServiceMetadataJSONString(): string
  • JSON-encoded metadata for the remote peer that is provided 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.

    Uses UTF-8 encoding.

    Returns string

  • get peerKeyString(): string
  • The unique peer key of the remote peer.

    Returns string

    See

    field peerKeyString on Peer for more information on peer keys.

  • get peerMetadata(): Record<string, any>
  • Metadata associated with the remote peer.

    This is an empty object if the remote peer has not set any metadata, or when this request is for a WebSocket connection (which does not currently support peer metadata).

    Set peer metadata for the local peer using Presence.peerMetadata or Presence.peerMetadataJSONString.

    This is a convenience property that wraps peerMetadataJSONString().

    Returns Record<string, any>

  • get peerMetadataJSONString(): string
  • JSON-encoded metadata associated with the remote peer.

    This is a JSON string representing an empty dictionary if the remote peer has not set any metadata or when this request is for a WebSocket connection.

    Set peer metadata for the local peer using Presence.peerMetadata or Presence.peerMetadataJSONString.

    Uses UTF-8 encoding.

    Returns string