Skip to main content

Overview

Connect to the Chidori WebSocket server to receive real-time driver location updates for your deliveries. This is ideal for building live tracking maps and interfaces.
Required permission: location:read
WebSocket is only available in the live environment. Sandbox mode does not support real-time location tracking.

Connection details

Authentication

Pass your live API key in the auth object when connecting:
Alternatively, pass it as a query parameter:

Security: User-scoped subscriptions

You can only subscribe to deliveries that belong to your account. When you subscribe to a delivery, the server verifies that the delivery’s userId matches your API key’s owner. This ensures you only receive location updates for your own deliveries.
Attempting to subscribe to another user’s delivery will result in an error: “Delivery not found or not owned by you”

Events

Events to emit (client → server)

Events to listen (server → client)

Connection example

Location update payload

When the driver’s location changes, you receive:
string
The delivery ID you subscribed to
object
string
The driver’s ID (may be null if not yet assigned)
string
ISO 8601 timestamp of the location update

Error handling

Best practices

Reconnection

Socket.IO handles reconnection automatically. Configure retry settings as needed.

Unsubscribe

Always unsubscribe from deliveries when no longer needed to reduce server load.

Error handling

Handle connection errors gracefully and show appropriate UI feedback.

Fallback

Use the REST API to poll delivery status if WebSocket connection fails.

Installation

Install the Socket.IO client:

Next steps

Get Delivery

Get delivery details via REST API

Webhooks

Receive status change notifications via webhooks