WebRTC Manual Pairing

TurboWarp extension documentation

WebRTC Manual Pairing: complete block reference

All 48 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

set ICE mode [MODE]

Sets whether new peer connections use LAN-only ICE or public STUN servers.

Block type: COMMAND. Opcode: setIceMode. Permanent link

ArgumentTypeDefault valueMenu choices
MODESTRINGlan

create offer code for peer [PEER]

Creates a manual pairing offer code for the named peer.

Block type: COMMAND. Opcode: createOffer. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

offer code for peer [PEER]

Returns the latest offer code generated for the named peer.

Block type: REPORTER. Opcode: getOffer. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

accept offer code [CODE] as peer [PEER]

Accepts a peer's offer code and creates an answer code.

Block type: COMMAND. Opcode: acceptOffer. Permanent link

ArgumentTypeDefault valueMenu choices
CODESTRINGoffer-code
PEERSTRINGpeer-a

answer code for peer [PEER]

Returns the latest answer code generated for the named peer.

Block type: REPORTER. Opcode: getAnswer. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

accept answer code [CODE] for peer [PEER]

Completes pairing by accepting a peer's answer code.

Block type: COMMAND. Opcode: acceptAnswer. Permanent link

ArgumentTypeDefault valueMenu choices
CODESTRINGanswer-code
PEERSTRINGpeer-a

send event [TYPE] payload [PAYLOAD] channel [CHANNEL] to peer [PEER]

Sends a JSON event envelope to one peer, or to all peers when PEER is *.

Block type: COMMAND. Opcode: sendEvent. Permanent link

ArgumentTypeDefault valueMenu choices
TYPESTRINGdoor-open
PAYLOADSTRING{}
CHANNELSTRINGdefault
PEERSTRING*

set latest-data channels enabled [ENABLED]

Opts in or out of unreliable latest-data channels. The default is disabled.

Block type: COMMAND. Opcode: setLatestDataEnabled. Permanent link

ArgumentTypeDefault valueMenu choices
ENABLEDBOOLEANfalse

configure latest-data channel [CHANNEL] high-water mark [HIGH_WATER_MARK] bytes for peer [PEER]

Configures a named latest-data channel before creating an offer.

Block type: COMMAND. Opcode: configureLatestDataChannel. Permanent link

ArgumentTypeDefault valueMenu choices
CHANNELSTRINGpose
HIGH_WATER_MARKNUMBER262144
PEERSTRINGpeer-a

send latest data [PAYLOAD] channel [CHANNEL] to peer [PEER]

Sends without waiting, or drops the new value when bufferedAmount exceeds the high-water mark.

Block type: COMMAND. Opcode: sendLatestData. Permanent link

ArgumentTypeDefault valueMenu choices
PAYLOADSTRING{}
CHANNELSTRINGpose
PEERSTRINGpeer-a

latest-data buffered bytes for channel [CHANNEL] peer [PEER]

Returns the browser DataChannel bufferedAmount for a named latest-data channel.

Block type: REPORTER. Opcode: latestDataBufferedAmount. Permanent link

ArgumentTypeDefault valueMenu choices
CHANNELSTRINGpose
PEERSTRINGpeer-a

latest-data sent count for channel [CHANNEL] peer [PEER]

Returns the number of values handed to the named latest-data channel.

Block type: REPORTER. Opcode: latestDataSentCount. Permanent link

ArgumentTypeDefault valueMenu choices
CHANNELSTRINGpose
PEERSTRINGpeer-a

latest-data dropped count for channel [CHANNEL] peer [PEER]

Returns the number of new values dropped by backpressure.

Block type: REPORTER. Opcode: latestDataDroppedCount. Permanent link

ArgumentTypeDefault valueMenu choices
CHANNELSTRINGpose
PEERSTRINGpeer-a

latest-data state for channel [CHANNEL] peer [PEER]

Returns disabled, not-configured, connecting, open, closing, or closed.

Block type: REPORTER. Opcode: latestDataChannelState. Permanent link

ArgumentTypeDefault valueMenu choices
CHANNELSTRINGpose
PEERSTRINGpeer-a

latest-data drop policy

Returns the fixed backpressure policy, drop-newest.

Block type: REPORTER. Opcode: latestDataDropPolicy. Permanent link

This block has no arguments.

WebRTC runtime capability version

Returns the version of the runtime API for composite extensions.

Block type: REPORTER. Opcode: runtimeCapabilityVersion. Permanent link

This block has no arguments.

require WebRTC runtime capability version [VERSION]

Throws an explicit error when the requested runtime API version is unsupported.

Block type: COMMAND. Opcode: requireRuntimeCapabilityVersion. Permanent link

ArgumentTypeDefault valueMenu choices
VERSIONNUMBER2

broadcast network message [MESSAGE] payload [PAYLOAD] channel [CHANNEL] to peer [PEER]

Sends a network broadcast message envelope to one peer, or to all peers when PEER is *.

Block type: COMMAND. Opcode: broadcastNetworkMessage. Permanent link

ArgumentTypeDefault valueMenu choices
MESSAGESTRINGdoor-open
PAYLOADSTRING{}
CHANNELSTRINGdefault
PEERSTRING*

when I receive network message [MESSAGE]

Starts scripts when a matching network broadcast message is received.

Block type: EVENT. Opcode: whenReceiveNetworkMessage. Permanent link

ArgumentTypeDefault valueMenu choices
MESSAGESTRINGdoor-open
  • door-open
  • event
  • *

network message payload

Returns the payload of the most recently received network broadcast message as JSON.

Block type: REPORTER. Opcode: networkMessagePayload. Permanent link

This block has no arguments.

network message sender

Returns the sender ID of the most recently received network broadcast message.

Block type: REPORTER. Opcode: networkMessageSender. Permanent link

This block has no arguments.

network message peer

Returns the local peer name that received the most recent network broadcast message.

Block type: REPORTER. Opcode: networkMessagePeer. Permanent link

This block has no arguments.

network message channel

Returns the channel of the most recently received network broadcast message.

Block type: REPORTER. Opcode: networkMessageChannel. Permanent link

This block has no arguments.

has received messages?

Reports whether the receive queue contains at least one message.

Block type: BOOLEAN. Opcode: hasMessages. Permanent link

This block has no arguments.

received message count

Returns the number of messages currently waiting in the receive queue.

Block type: REPORTER. Opcode: messageCount. Permanent link

This block has no arguments.

next received message

Removes and returns the oldest received message as JSON.

Block type: REPORTER. Opcode: nextMessage. Permanent link

This block has no arguments.

last received message

Returns the most recent received message as JSON without removing it.

Block type: REPORTER. Opcode: lastMessage. Permanent link

This block has no arguments.

clear received messages

Clears the receive queue.

Block type: COMMAND. Opcode: clearMessages. Permanent link

This block has no arguments.

connection state of peer [PEER]

Returns the WebRTC connection state for the named peer.

Block type: REPORTER. Opcode: connectionState. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

connected peers

Returns a JSON array of connected peer names.

Block type: REPORTER. Opcode: connectedPeers. Permanent link

This block has no arguments.

close peer [PEER]

Closes and removes a peer connection.

Block type: COMMAND. Opcode: closePeer. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

sync clock with peer [PEER]

Runs a clock probe exchange with the peer and stores the resulting clock offset.

Block type: COMMAND. Opcode: syncClock. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

clock offset to peer [PEER] us

Returns the microseconds to add to a local timestamp to express it in the peer's clock.

Block type: REPORTER. Opcode: clockOffset. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

clock round trip to peer [PEER] us

Returns the shortest round trip observed while probing the peer, in microseconds.

Block type: REPORTER. Opcode: clockRoundTrip. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

clock uncertainty to peer [PEER] us

Returns the clock offset uncertainty for the peer in microseconds, which is half the shortest round trip.

Block type: REPORTER. Opcode: clockUncertainty. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

time in clock of peer [PEER] us

Returns the current local time expressed in the peer's clock, in microseconds. Errors when the peer clock has not been probed yet.

Block type: REPORTER. Opcode: peerTime. Permanent link

ArgumentTypeDefault valueMenu choices
PEERSTRINGpeer-a

local time us

Returns the local high-resolution clock in microseconds.

Block type: REPORTER. Opcode: localTime. Permanent link

This block has no arguments.

frame latency us for capture [CAPTURE_US] pattern [PATTERN_US] wrap [WRAP_US] from peer [PEER]

Returns how many microseconds after the displayed pattern time the local frame was captured. CAPTURE_US is a local timestamp, PATTERN_US is the decoded display time in the peer's clock, and WRAP_US is the pattern repeat period, or 0 when the pattern never repeats. Errors when the peer clock has not been probed yet. A negative result means the clock offset or the frame age correction exceeded the real latency.

Block type: REPORTER. Opcode: frameLatency. Permanent link

ArgumentTypeDefault valueMenu choices
CAPTURE_USNUMBER0
PATTERN_USNUMBER0
WRAP_USNUMBER4096000
PEERSTRINGpeer-a

record frame sync sample for camera [CAMERA] capture [CAPTURE_US] pattern [PATTERN_US] wrap [WRAP_US] from peer [PEER]

Converts one pattern observation into a latency sample and stores it for the camera slot. Errors when the peer clock has not been probed yet.

Block type: COMMAND. Opcode: recordFrameSyncSample. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1
CAPTURE_USNUMBER0
PATTERN_USNUMBER0
WRAP_USNUMBER4096000
PEERSTRINGpeer-a

clear frame sync samples for camera [CAMERA]

Clears the latency samples stored for the camera slot.

Block type: COMMAND. Opcode: clearFrameSyncSamples. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1

frame sync sample count for camera [CAMERA]

Returns how many latency samples are stored for the camera slot.

Block type: REPORTER. Opcode: frameSyncSampleCount. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1

frame sync summary for camera [CAMERA]

Returns the local latency summary for the camera slot as a JSON report.

Block type: REPORTER. Opcode: frameSyncSummary. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1

send frame sync report for camera [CAMERA] to peer [PEER]

Sends the camera slot's latency summary to the peer on the internal sync channel.

Block type: COMMAND. Opcode: sendFrameSyncReport. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1
PEERSTRINGpeer-a

frame sync report

Returns every received frame sync report together with per-camera offsets as JSON.

Block type: REPORTER. Opcode: frameSyncReport. Permanent link

This block has no arguments.

frame sync cameras

Returns a JSON array of the camera slots that have reported.

Block type: REPORTER. Opcode: frameSyncCameras. Permanent link

This block has no arguments.

frame sync latency us of camera [CAMERA]

Returns the reported median capture latency of the camera slot in microseconds.

Block type: REPORTER. Opcode: frameSyncLatencyOfCamera. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1

frame sync offset us of camera [CAMERA]

Returns how many microseconds later than the reference camera this camera finishes recording a frame. Subtract it from the camera's frame timestamps to align the cameras.

Block type: REPORTER. Opcode: frameSyncOffsetOfCamera. Permanent link

ArgumentTypeDefault valueMenu choices
CAMERASTRINGcamera-1

clear frame sync report

Clears every received frame sync report.

Block type: COMMAND. Opcode: clearFrameSyncReport. Permanent link

This block has no arguments.

Repository guide and examples

Fixed input editing

With a compatible TurboWarp GUI, enable fixed-input forms to edit only standard literal fields. Numbers use complete finite JSON number tokens; menu fields use existing choices. Connected reporters and unavailable fields stay read-only and are never evaluated. Saving an unchanged form preserves exact existing raw values, including legacy spellings and unknown choices. Invalid drafts stay in the same editing session; cancel, project/target replacement, or block removal discards them. Disabling the GUI feature flag restores native field editing. This form does not run blocks, open network/audio/key/QR sessions, resolve names, or edit Schema arguments. VERSION stays a numeric field restricted to 1, 2, or 3. ENABLED is a Boolean socket and is not a save target. Timestamp/wrap sentinels and high-water-mark runtime clamping remain unchanged.