WebSocket
Waypath provides a WebSocket connection for real-time graph mutation events. The dashboard uses this to update the Intelligence and Pipeline views live.
Connecting
const ws = new WebSocket('wss://api.waypath.app/ws')
ws.onopen = () => {
console.log('Connected to Waypath')
}
ws.onmessage = (event) => {
const mutation = JSON.parse(event.data)
console.log('Graph mutation:', mutation)
}For local development: ws://localhost:4747/ws
Mutation events
Each message contains a graph mutation event:
{
"type": "node_added",
"data": {
"id": "node_abc123",
"label": "Customer",
"properties": {
"name": "Sarah Chen",
"email": "sarah@example.com"
}
}
}Event types
| Type | Description |
|---|---|
node_added | A new node was created in the graph |
node_updated | An existing node’s properties changed |
node_removed | A node was deleted |
edge_added | A new relationship was created |
edge_removed | A relationship was deleted |
graph_rebuilt | The full graph was reconstructed from Pipeline data |
When events fire
WebSocket events broadcast on:
- Event ingestion (new touchpoints, customers)
- CRM mutations (Pipeline edits)
- Integration syncs (new data from connected platforms)
- Graph rebuilds (scheduled or triggered)