{"_id":"@ambulancewa/linxio-js","_rev":"2-9e7e3c9434f662ba82bd346d37564d4b","name":"@ambulancewa/linxio-js","dist-tags":{"latest":"2.24.5"},"versions":{"2.23.2":{"name":"@ambulancewa/linxio-js","version":"2.23.2","keywords":["linxio","fleet","gps","sdk","typescript"],"author":"Ambulance WA","license":"MIT","_id":"@ambulancewa/linxio-js@2.23.2","maintainers":[{"name":"ambulancewa","email":"contact@ambulancewa.com.au"}],"homepage":"https://linxio-js.ambulancewa.dev","bugs":{"url":"https://github.com/ambulancewa/linxio-js/issues"},"dist":{"shasum":"41f88a9c693112542c3f70b6069e307aec858f89","tarball":"https://registry.npmjs.org/@ambulancewa/linxio-js/-/linxio-js-2.23.2.tgz","fileCount":9,"integrity":"sha512-lurQU4S5cChOwarG18ZrbggMW/rdZmUXAoIyw/j8kE23+Wn0Fh1ioCs4RnTBWqJl1lxQVtHhmQEZVJbxL3CVAQ==","signatures":[{"sig":"MEYCIQDQH0CMMZAZQ80YuB+FnJ0lTh46Loijn/Ls5fz79M/3+AIhALghqo06BZCJyAj+nkekLdR85Z8TrZF8olwWCzu5W+eF","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":609726},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=20.11"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"private":false,"scripts":{"pub":"pnpm prepack && npm publish --access public","lint":"pnpm lint:sdk && pnpm --dir docs lint","test":"vitest run","build":"tsup","format":"pnpm format:sdk && pnpm --dir docs format","verify":"pnpm lint && pnpm typecheck && pnpm test && pnpm build && pnpm docs:check","docs:dev":"pnpm --dir docs dev","lint:sdk":"biome check src scripts package.json tsconfig.json tsup.config.ts pnpm-workspace.yaml --config-path ./biome.json","bump-deps":"npx npm-check-updates --deep -u -x @biomejs/biome","typecheck":"tsc --noEmit","docs:build":"pnpm --dir docs build","docs:check":"pnpm --dir docs types:check","format:sdk":"biome check src scripts package.json tsconfig.json tsup.config.ts pnpm-workspace.yaml --write --config-path ./biome.json","live:smoke":"node scripts/live-smoke.mjs","format:biome":"pnpm format:sdk","live:contract":"pnpm build && node scripts/live-contract.mjs","analyze:sources":"pnpm build && node scripts/analyze-dashboard-sources.mjs","live:contract:mutations":"pnpm build && node scripts/live-contract.mjs --mutations"},"_npmUser":{"name":"ambulancewa","email":"contact@ambulancewa.com.au"},"repository":{"url":"git+https://github.com/ambulancewa/linxio-js.git","type":"git"},"description":"linxio-js is a secure, lightweight, high-performance Node.js SDK for interacting with the Linxio Fleet Management API. Query vehicles, drivers, and devices, stream live GPS positions, subscribe to real-time notifications, auto-paginate large fleets, expor","directories":{},"sideEffects":false,"_nodeVersion":"26.0.0","dependencies":{"socket.io-client":"^4.8.3"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","sharp":"^0.34.5","turbo":"^2.9.16","vitest":"^4.1.8","prettier":"^3.8.3","ultracite":"^7.8.1","typescript":"^6.0.3","@types/node":"^25.9.2","@biomejs/biome":"2.4.15","semantic-release":"^25.0.3","typed-query-selector":"^2.12.2","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.5","@semantic-release/github":"^12.0.8","@total-typescript/ts-reset":"^0.6.1","@semantic-release/changelog":"^6.0.3","prettier-plugin-tailwindcss":"^0.8.0","@auto-it/first-time-contributor":"^11.3.6","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/release-notes-generator":"^14.1.1","prettier-plugin-tailwindcss-canonical-classes":"^0.1.5"},"_npmOperationalInternal":{"tmp":"tmp/linxio-js_2.23.2_1781077901419_0.8296566054814305","host":"s3://npm-registry-packages-npm-production"}},"2.24.5":{"name":"@ambulancewa/linxio-js","version":"2.24.5","packageManager":"pnpm@11.20.0","private":false,"description":"linxio-js is a secure, lightweight, high-performance Node.js SDK for interacting with the Linxio Fleet Management API. Query vehicles, drivers, and devices, stream live GPS positions, subscribe to real-time notifications, auto-paginate large fleets, expor","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"build":"node scripts/prepare-build-version.mjs && tsup","docs:build":"pnpm --dir docs build","docs:check":"pnpm --dir docs types:check","docs:dev":"pnpm --dir docs dev","analyze:sources":"pnpm build && node scripts/analyze-dashboard-sources.mjs","format":"pnpm format:sdk && pnpm --dir docs format","format:biome":"pnpm format:sdk","format:sdk":"biome check src scripts package.json tsconfig.json tsup.config.ts pnpm-workspace.yaml --write --config-path ./biome.json","lint":"pnpm lint:sdk && pnpm --dir docs lint","lint:sdk":"biome check src scripts package.json tsconfig.json tsup.config.ts pnpm-workspace.yaml --config-path ./biome.json","live:contract":"pnpm build && node scripts/live-contract.mjs","live:contract:mutations":"pnpm build && node scripts/live-contract.mjs --mutations","live:smoke":"node scripts/live-smoke.mjs","prepack":"pnpm format && pnpm build","test":"vitest run","typecheck":"tsc --noEmit","verify":"pnpm lint && pnpm typecheck && pnpm test && pnpm build && pnpm docs:check","pub":"pnpm prepack && npm publish --access public","bump-deps":"npx npm-check-updates --deep -u -x @biomejs/biome,typescript"},"keywords":["linxio","fleet","gps","sdk","typescript"],"author":{"name":"Ambulance WA"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/ambulancewa/linxio-js.git"},"bugs":{"url":"https://github.com/ambulancewa/linxio-js/issues"},"homepage":"https://linxio-js.ambulancewa.dev","engines":{"node":">=20.11"},"dependencies":{"socket.io-client":"^4.8.3"},"devDependencies":{"@auto-it/first-time-contributor":"^11.3.6","@biomejs/biome":"2.4.15","@semantic-release/changelog":"^7.0.0","@semantic-release/commit-analyzer":"^13.0.1","@semantic-release/git":"^11.0.1","@semantic-release/github":"^12.0.9","@semantic-release/npm":"^13.1.5","@semantic-release/release-notes-generator":"^14.1.1","@total-typescript/ts-reset":"^0.6.1","@types/node":"^26.1.2","prettier":"^3.9.6","prettier-plugin-tailwindcss":"^0.8.1","prettier-plugin-tailwindcss-canonical-classes":"^0.1.5","semantic-release":"^25.0.8","sharp":"^0.35.3","tsup":"^8.5.1","turbo":"^2.10.8","typed-query-selector":"^2.12.2","typescript":"^6.0.3","ultracite":"^7.10.0","vitest":"^4.1.10"},"sideEffects":false,"gitHead":"4f37003bbe82c00167d43f077a7fb25f647b3d98","_id":"@ambulancewa/linxio-js@2.24.5","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-8gsb79AN90cNubRwvBLw/ZjrbnPr8bIZnDPg+QVUmGD9wgplPUH0mURyafx1ySg8LAD0XUHQj6iYDcyTg/zaUw==","shasum":"f2ea5ec12ec3b64d244a051cf8acf7b2686a78a0","tarball":"https://registry.npmjs.org/@ambulancewa/linxio-js/-/linxio-js-2.24.5.tgz","fileCount":9,"unpackedSize":612930,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIAQRxyyU986Lk9E1z8MvuKyOBWynVQsrzud0jopcxViKAiEAiFQ582C5By9zFcsSULBDAKRJCk8pwj45ci7amiQhDOU="}]},"_npmUser":{"name":"ambulancewa","email":"contact@ambulancewa.com.au"},"directories":{},"maintainers":[{"name":"ambulancewa","email":"contact@ambulancewa.com.au"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/linxio-js_2.24.5_1785803774140_0.7513784586472938"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-10T07:51:41.183Z","modified":"2026-08-04T00:36:14.474Z","2.23.2":"2026-06-10T07:51:41.577Z","2.24.5":"2026-08-04T00:36:14.291Z"},"bugs":{"url":"https://github.com/ambulancewa/linxio-js/issues"},"author":{"name":"Ambulance WA"},"license":"MIT","homepage":"https://linxio-js.ambulancewa.dev","keywords":["linxio","fleet","gps","sdk","typescript"],"repository":{"type":"git","url":"git+https://github.com/ambulancewa/linxio-js.git"},"description":"linxio-js is a secure, lightweight, high-performance Node.js SDK for interacting with the Linxio Fleet Management API. Query vehicles, drivers, and devices, stream live GPS positions, subscribe to real-time notifications, auto-paginate large fleets, expor","maintainers":[{"name":"ambulancewa","email":"contact@ambulancewa.com.au"}],"readme":"![@ambulancewa/linxio-js](https://github.com/ambulancewa/linxio-js/blob/master/repo-header.png)\r\n\r\nlinxio-js is a secure, lightweight, high-performance Node.js SDK for interacting with the [`Linxio`](https://linxio.com/) API. The client is fully-typed for use in Typescript projects, and is available as ECMAScript and CommonJS modules for use pretty much anywhere you can run Javascript. Query vehicles, drivers, and devices, stream live GPS positions, subscribe to real-time notifications, auto-paginate large fleets, export reports, manage geofences and routes, and more!\r\n\r\n```ts\r\nimport { createClient } from \"@ambulancewa/linxio-js\";\r\n\r\nconst linxio = createClient();\r\n\r\nawait linxio.auth.login({\r\n    email: process.env.LINXIO_EMAIL!,\r\n    password: process.env.LINXIO_PASSWORD!,\r\n});\r\n\r\nconst { data, error } = await linxio.vehicles.iterate({\r\n    fields: [\"id\", \"regNo\", \"lastLoggedAt\"],\r\n    limit: 100,\r\n});\r\n```\r\n\r\n## 👏 Key Features\r\n\r\n- Fully typed TypeScript API.\r\n- Available as both ESM and CommonJS packages.\r\n- Fetch-native HTTP client with timeouts, typed errors, and safe JSON handling.\r\n- Service methods return `{ data, error }` results for straightforward script ergonomics.\r\n- Automatic JWT refresh with concurrent refresh coalescing.\r\n- Exponential backoff retries for idempotent requests.\r\n- Domain services for vehicles, routes, geofences, devices, drivers, sensors, fuel, users, clients, reports, digital forms, cameras, and realtime.\r\n- Auto-pagination helpers and streaming iterators for paginated endpoints.\r\n- Low-level `client.request()` escape hatch for tenant-specific endpoints.\r\n- Socket.IO realtime helpers for live coordinates and notifications.\r\n\r\n## 📦 Installation\r\n\r\nPrerequisites for installation:\r\n- [Node.js](https://nodejs.org/en/download/) (v14 or higher)\r\n- [pnpm](https://pnpm.io/installation) or your preferred compatible package manager\r\n\r\nInstallation is super straightforward. Simply install the package from npmjs:\r\n\r\n```bash\r\npnpm add @ambulancewa/linxio-js\r\n```\r\n\r\nFull documentation is available at our Open Source Software Projects (OSSP) site: https://linxio-js.ambulancewa.dev\r\n\r\n## ⚡ Usage\r\n\r\n```ts\r\nconst login = await linxio.auth.login({\r\n    email,\r\n    password,\r\n    domain: \"optional-domain\",\r\n});\r\n\r\nif (login.error) {\r\n    throw login.error;\r\n}\r\n\r\nconsole.log(login.data.expireAt);\r\n```\r\n\r\nOnce initialised, you can use the client to query the Linxio API:\r\n\r\n```ts\r\nconst { data: vehicles, error, meta } = await linxio.vehicles.list({\r\n    fields: [\"id\", \"regNo\"],\r\n    limit: 50,\r\n    sort: \"regNo\",\r\n});\r\n\r\nif (error) {\r\n    throw error;\r\n}\r\n\r\nconsole.log(meta.total, vehicles);\r\n\r\nconst routes = await linxio.routes.getVehicleRoutes(vehicles[0].id, {\r\n    dateFrom: \"2026-06-01T00:00:00+08:00\",\r\n    dateTo: \"2026-06-08T00:00:00+08:00\",\r\n});\r\n```\r\n\r\n## ⚙️ Advanced requests\r\n\r\nUse domain services for normal workflows. For tenant-specific or newly\r\ndiscovered endpoints, `client.request()` keeps the same auth, retry, timeout,\r\nand token-refresh behavior.\r\n\r\n```ts\r\nconst response = await linxio.request(\"GET\", \"/vehicles/count\");\r\n```\r\n\r\n## 🔴 Realtime\r\n\r\n```ts\r\nconst unsubscribe = linxio.realtime.onPosition([304], (position) => {\r\n    console.log(position.vehicleId, position.lat, position.lng);\r\n});\r\n\r\nunsubscribe();\r\n```\r\n\r\n## ❌ Errors\r\n\r\n```ts\r\nimport { LinxioApiError } from \"@ambulancewa/linxio-js\";\r\n\r\nconst { error } = await linxio.vehicles.create({});\r\n\r\nif (error instanceof LinxioApiError) {\r\n    console.error(error.status, error.path, error.body);\r\n}\r\n```\r\n\r\nLow-level `client.request()` calls throw typed SDK errors directly.","readmeFilename":"README.md"}