linxio-js
SDK Reference

Overview

TypeScript client options, result contracts, service pages, and shared SDK conventions.

Services

Service Surface
linxio.auth
loginverifyOtprefreshmelogout
linxio.vehicles
listiteratestreamgetcreateupdatearchiverestoregetOdometerrecalibrateOdometergetEngineHourscounttypes
linxio.devices
listiteratestreamgetcreateupdateinstalluninstallarchiverestorecoordinatessensorshistoryvendorsinstallationscameras
linxio.users, linxio.clients, linxio.drivers, linxio.resellers
userclientdriverand reseller account workflows
linxio.geofences
area and area-group lifecycle workflows
linxio.fuel
recordssummariescardsfuel typestransaction assignment
linxio.reports, linxio.digitalForms
scheduled reports and digital form answer downloads
linxio.routes, linxio.sensors, linxio.cameras
route historytemperature/humidity reportsand camera events
linxio.metadata
read-only tenant settings and reference data
linxio.realtime
connectsubscribeonPositiononNotificationdisconnect
linxio.request, linxio.http
raw HTTP access with SDK authretrytimeoutand refresh behavior
exported utilities
result helperspagination helpersendpoint catalogue helpers

Create a client

createClient(options)

Creates a reusable Linxio SDK client. Use one client per Linxio session in scripts, workers, and backend services.

Options

string
optional
REST API base URL.
Default: https://api.linxio.com/api
string
optional
JWT bearer token for an existing session.
string
optional
Refresh token used for automatic 401 recovery.
number
optional
Per-request timeout in milliseconds.
Default: 30000
RetryOptions
optional
Retry configuration for idempotent requests that fail with transient network or 5xx errors.
FetchLike
optional
Custom fetch implementation for tests, proxies, or non-standard runtimes.
string
optional
Socket.IO tracking host.
Default: https://track.linxio.com

Result Contract

Domain service methods return result objects so scripts can branch without wrapping every call in try/catch.

Service methods normalize Linxio response envelopes, including result, data, and endpoint-key collection wrappers, so result.data contains the developer-facing payload. Use client.request() when you need the raw wire response for diagnostics.

LinxioResult<T>

T | null
optional
Successful response payload. Null when the call failed.
optional
Typed SDK error. Null when the call succeeded.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.

LinxioPageResult<T>

T[] | null
optional
Current page of records, or null when the request failed.
optional
Typed SDK error. Null when the page was loaded successfully.
Show child fields
string
required
Safe error message.
string
required
SDK error class name.
unknown
optional
Original cause when available.
string
optional
HTTP method when the error came from a request.
string
optional
API path when the error came from a request.
string
optional
Request identifier from X-Request-Id when supplied.
optional
Normalized pagination metadata.
Show child fields
number
required
Page size.
number
required
Current page number.
number
required
Total matching record count.
unknown
optional
Aggregation payload returned by Linxio when the endpoint includes it.

Shared list parameters

Parameters

number
optional
Number of records to request per page.
number
optional
Page number to request.
Default: 1
string
optional
Sort expression accepted by the underlying Linxio endpoint.
string[]
optional
Mapped to Linxio's fields[] query parameter to keep responses small.
string | number | boolean | string[] | number[]
optional
Additional endpoint-specific filters are forwarded as query parameters.

Pagination helpers

Use list() when you want one page, iterate() when you want a result object containing every page, and stream() when you want to process large tenants without holding every record in memory.

One page
const page = await linxio.vehicles.list({
  fields: ["id", "regNo"],
  limit: 100,
  page: 1,
});
All pages with a result object
const { data: vehicles, error } = await linxio.vehicles.iterate({
  fields: ["id", "regNo", "lastLoggedAt"],
  limit: 100,
});

if (error) {
  throw error;
}
Lazy streaming
for await (const vehicle of linxio.vehicles.stream({ limit: 100 })) {
  console.log(vehicle.id, vehicle.regNo);
}

On this page