client.tracking provides two distinct tracking methods designed for different contexts. trackShipment is intended for customer-facing use — it returns a sanitised public view of the shipment status and can be called with a publishable key. getShipmentTracking is for backend use — it returns the full event history with timestamps, locations, and status codes, and requires a secret key.
Methods
trackShipment
Look up the current status of a shipment using its public tracking number. This method is safe to call from a customer-facing context — it returns only the information appropriate for end-customer consumption. The endpoint is edge-cached (~15 seconds) and ETag-validated; send the returned ETag back as If-None-Match to receive a 304 when the status has not changed.
This is a public endpoint — it works with a publishable key (
tybrite_pk_*), so you can safely build a “track my order” page in the browser without exposing a secret key.string
required
The public tracking number assigned to the shipment (e.g.
TLDP-20260608-0001). Available in the shipment response as the tracking_number field.Public Tracking Fields
ThetrackShipment response returns a PublicTracking object with the following fields.
getShipmentTracking
Retrieve the full event history for a shipment by its internal ID. This method requires a secret key and is intended for server-side use — for example, to display a detailed timeline in an operations dashboard or to audit delivery performance.
string
required
The internal shipment ID (e.g.
shp_abc123), not the public tracking number.TrackingEvent Fields
Each event in theevents array represents a discrete status change in the shipment’s journey.
Shipment Status Values
Both tracking methods return astatus field using the following enumerated values. All values are lowercase strings.
Cancellation
Each call totrackShipment or getShipmentTracking returns a CancelablePromise. Call .cancel() to abort an in-flight request — useful in polling loops or when a component unmounts before the request completes.