Live demo

Pair two tabs, draw like a phone

Open this page twice in the same browser. Make one the host and the other the controller. Everything travels over BroadcastChannel; nothing leaves your machine.

Tip: put the two windows side by side to watch strokes arrive in realtime.

How it works

The host turns its PIN into a channel name starting with snap-pair-demo/; the controller joins the same channel with the same PIN. Pointer positions are normalized to 0–1 and batched once per animation frame. Heartbeats detect disconnects. In a real app BroadcastChannelTransport does all of this for you, and swapping in PartyKitTransport or WebRTCTransport takes it across the internet.