WebSocket (Real-time)
Socket.IO namespaces, connection examples, and event documentation for real-time communication.
Open VTS uses Socket.IO for real-time communication. Unlike the REST API, WebSocket connections are persistent and push data to connected clients immediately.
WebSocket connections are separate from REST endpoints. They require a valid JWT token passed during the connection handshake — not in HTTP headers.
Telemetry Gateway
Namespace
/telemetryAuthJWT token sent on connection
Live vehicle position and status updates via Socket.IO.
Connection
const socket = io('wss://api.openvts.io/telemetry', {
auth: { token: 'Bearer eyJhbGciOiJI...' }
});Events Received
telemetry_updatePayload
{ imei, lat, lng, speed, heading, timestamp, ... }vehicle_statusPayload
{ imei, status: "running"/"idle"/"stopped" }Notification Gateway
Namespace
/notificationsAuthJWT token sent on connection
Real-time notifications and vehicle alerts via Socket.IO.
Connection
const socket = io('wss://api.openvts.io/notifications', {
auth: { token: 'Bearer eyJhbGciOiJI...' }
});Events Received
notificationPayload
{ id, title, message, category, timestamp }alertPayload
{ vehicleId, type, severity, message, coordinates }