API Reference

Nearby discovery

Check app.capabilities for feature support and app.access plus host permissions for authorization. Examples use synthetic values; replace paths, IDs, inputs and filters before calling.

Device A
UDP → 224.0.0.251:5353
Device B

PTR query

UDP · DNS

IPv4 multicast, not an IP broadcast: 224.0.0.251:5353. A browses every 5 s; B also announces on startup and every 60 s. PTR answers include SRV, TXT and A. Decoded synthetic DNS records are shown in the popups.

Hover or tap a field
1 / 3

Type Definitions

graphql
type Mutation {
  acquireMdnsDebugSession(token: String!): Boolean!
  releaseMdnsDebugSession(token: String!): Boolean!
  startDiscovery: Boolean!
  stopDiscovery: Boolean!
}

type Query {
  isDiscovering: Boolean!
  mdnsState: MdnsState!
  nearbyDevices: [NearbyDevice!]!
  parsePairingQrCode(code: String!): NearbyDevice
}

enum DeviceType {
	COMPUTER
	PHONE
	TABLET
	TV
	NAS
	OTHER
}

enum DiscoveryMethod {
	LAN
	BLE
	QR
}

scalar Instant

scalar Long

type MdnsActivity {
	time: Instant!
	event: String!
	detail: String!
}

type MdnsPacket {
	time: Instant!
	direction: MdnsPacketDirection!
	srcIp: String!
	srcPort: Int!
	dstIp: String!
	dstPort: Int!
	size: Long!
	summary: String!
	detail: String!
}

enum MdnsPacketDirection {
	IN
	OUT
}

type MdnsService {
	serviceType: String!
	instanceName: String!
	instanceFqdn: String!
	hostname: String!
	port: Int!
	txtRecords: [String!]!
	ips: [String!]!
	ip6s: [String!]!
	complete: Boolean!
}

type MdnsState {
	runtimeId: String!
	packetsIn: [MdnsPacket!]!
	packetsOut: [MdnsPacket!]!
	revision: Long!
	running: Boolean!
	scanning: Boolean!
	services: [MdnsService!]!
	activity: [MdnsActivity!]!
}

type NearbyDevice {
	id: ID!
	name: String!
	ips: [String!]!
	port: Int!
	remoteAccess: Boolean
	signaturePublicKey: String!
	deviceType: DeviceType!
	version: String!
	platform: String!
	discoveryMethods: [DiscoveryMethod!]!
	bestIp: String!
	status: PeerStatus!
	lastSeen: Instant!
}

enum PeerStatus {
	PAIRED
	UNPAIRED
	CHANNEL
}

Operations

mutation

acquireMdnsDebugSession

Acquire an mDNS debug session using a caller-owned UUID token. Requires HTTP_SERVER support; release the session when the debug page closes.

graphql
mutation acquireMdnsDebugSession($token: String!) {
  acquireMdnsDebugSession(token: $token)
}
mutation

releaseMdnsDebugSession

Release the mDNS debug session with the matching token. Requires HTTP_SERVER support.

graphql
mutation releaseMdnsDebugSession($token: String!) {
  releaseMdnsDebugSession(token: $token)
}
mutation

startDiscovery

Start device discovery for five minutes. Calling again resets the five-minute timeout. Active discovery pages restart scanning when they observe that it has stopped.

graphql
mutation startDiscovery {
  startDiscovery
}
mutation

stopDiscovery

Stop device discovery immediately for all pages and clients, including scans started by a debug session.

graphql
mutation stopDiscovery {
  stopDiscovery
}
query

isDiscovering

Whether a discovery scan is currently running.

graphql
query isDiscovering {
  isDiscovering
}
query

mdnsState

Read the current mDNS discovery status and selected service or packet details.

graphql
query mdnsState {
  mdnsState { runtimeId revision running scanning }
}
query

nearbyDevices

List currently known nearby devices available for discovery or pairing.

graphql
query nearbyDevices {
  nearbyDevices { id name ips port remoteAccess signaturePublicKey deviceType version }
}
query

parsePairingQrCode

Decode a pairing code into nearby-device connection information when valid.

graphql
query parsePairingQrCode($code: String!) {
  parsePairingQrCode(code: $code) { id name ips port remoteAccess signaturePublicKey deviceType version }
}