Documentation Index
Fetch the complete documentation index at: https://docs.hoplynk.com/llms.txt
Use this file to discover all available pages before exploring further.
Install
Initialize
import { HoplynkClient } from '@hoplynk/sdk'
const client = new HoplynkClient({ apiKey: process.env.HOPLYNK_API_KEY })
Kits
// List all kits
const kits = await client.getAssets(kitId)
// GPS
const loc = await client.getLocation(kitId)
console.log(loc.lat, loc.lon, loc.source)
// Full telemetry
const snap = await client.getTelemetry(kitId, assetId)
Streaming
// Kit-level stream
const stream = client.stream({ kitId, feeds: ['gps', 'starlink'], interval: 1 })
stream.on('ready', ({ feeds }) => console.log('streaming', feeds))
stream.on('data', ({ feed, payload, ts }) => {
if (feed === 'gps') console.log(payload.lat, payload.lon)
})
stream.on('error', ({ message }) => console.error(message))
stream.on('close', () => console.log('disconnected'))
// Stop:
stream.close()
TypeScript types
import type {
GpsPayload,
StatusPayload,
TelemetrySnapshot,
StreamEvent,
} from '@hoplynk/sdk'
GpsPayload
| Field | Type | Description |
|---|
lat | number | Latitude (degrees) |
lon | number | Longitude (degrees) |
alt_m | number | null | Altitude (meters) |
source | string | starlink · starlink_cached · cellular · manual |
stale | boolean | true if fix is older than 30s |
timestamp | string | null | ISO 8601 UTC |
StatusPayload
| Field | Type | Description |
|---|
downlink_mbps | number | null | Download throughput |
uplink_mbps | number | null | Upload throughput |
pop_ping_latency_ms | number | null | Latency to Starlink POP |
alerts | string[] | Active alerts |