Skip to main content

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

npm install @hoplynk/sdk

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

FieldTypeDescription
latnumberLatitude (degrees)
lonnumberLongitude (degrees)
alt_mnumber | nullAltitude (meters)
sourcestringstarlink · starlink_cached · cellular · manual
stalebooleantrue if fix is older than 30s
timestampstring | nullISO 8601 UTC

StatusPayload

FieldTypeDescription
downlink_mbpsnumber | nullDownload throughput
uplink_mbpsnumber | nullUpload throughput
pop_ping_latency_msnumber | nullLatency to Starlink POP
alertsstring[]Active alerts