linxio-js
API Reference

Realtime

Socket.IO realtime coordinate and notification namespaces.

Realtime uses https://track.linxio.com and the Socket.IO path /socket.io. The SDK handles token query parameters and reconnect behaviour.

/coordinates namespace

Connect to live coordinates

https://track.linxio.com/coordinateslinxio.realtime.onPosition(vehicleIds, handler)

Receives live vehicle coordinate payloads after subscribing to vehicle IDs.

Connection parameters

token
string
required
JWT token passed as a Socket.IO query parameter.
path
/socket.io
optional
Socket.IO path.
subscribe.vehicleIds
number[]
required
Vehicle IDs sent with the subscribe event.

Payload fields

vehicleId
LinxioId
optional
Vehicle identifier.
lat / lng
number
optional
Current coordinate.
speed
number
optional
Speed when supplied.
heading
number
optional
Heading when supplied.
ts
ISODateString
optional
Timestamp when supplied.

/notifications namespace

Connect to notifications

https://track.linxio.com/notificationslinxio.realtime.onNotification(handler)

Receives Linxio notification payloads for notifications configured in the dashboard for the authenticated user.

Connection parameters

token
string
required
JWT token passed as a Socket.IO query parameter.
path
/socket.io
optional
Socket.IO path.

Payload fields

id
LinxioId
optional
Notification identifier when supplied.
type
string
optional
Notification type when supplied.
message
string
optional
Notification message when supplied.
vehicleId
LinxioId | null
optional
Related vehicle when supplied.
occurredAt
ISODateString
optional
Timestamp when supplied.

On this page