Protocol overview
The Waylocate embed protocol is a versioned postMessage contract between a host page and an embedded map iframe.
This documentation targets @waylocate/embed@0.2.1 speaking wire protocol waylocate: 1.
Layers
| Layer | Mechanism | Purpose |
|---|---|---|
| 0 | CampusController | Internal intent funnel (same code path as human clicks) |
| 1 | URL deep links | Initial state, shareable, no JS |
| 2 | postMessage protocol | Live control from the parent page |
| 3 | @waylocate/embed SDK | Typed wrapper over Layer 2 |
Design rules
- One intent funnel — host commands call the same functions a human click calls.
- References are slugs, never internal IDs.
- Every command is acknowledged with a correlation
id. - Every event carries its source (
user,host, orsystem). - The protocol is versioned from message one — the
waylocatefield is both namespace guard and version. - Humans always win — no controlled mode.
Sections
Try the protocol inspector against a live map.