Wire Taps
What is a wire tap?
Section titled “What is a wire tap?”A wire tap is a global observer that sees every envelope flowing through postal — across all channels and topics. Wire taps fire for publishes, requests, handler replies, and inbound envelopes from transports.
Use cases
Section titled “Use cases”Logging
Section titled “Logging”Debugging
Section titled “Debugging”Metrics
Section titled “Metrics”Error isolation
Section titled “Error isolation”Errors thrown by wiretaps are silently swallowed. Wiretaps are passive observers — they must never affect message dispatch:
Removing a wire tap
Section titled “Removing a wire tap”addWiretap returns a remove function:
Calling the remove function multiple times is safe — subsequent calls are no-ops.
resetWiretaps() removes all registered wiretaps. Wiretaps are also cleared when resetChannels() is called, which is primarily useful for test isolation:
Next steps
Section titled “Next steps”- Transports — bridge messages across tabs, iframes, and workers
- Concepts — channels, topics, wildcards, and envelopes
- Getting Started — installation and first message