npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

geotrack-js-sdk

v1.0.0

Published

SDK officiel JavaScript/TypeScript pour GeoTrack Pro

Readme

@geotrack/sdk

SDK officiel JavaScript/TypeScript pour l'API GeoTrack Pro — plateforme de géolocalisation de flotte, logistique et géofencing.

npm version TypeScript License: MIT

Installation

npm install @geotrack/sdk
# ou
yarn add @geotrack/sdk
# ou
pnpm add @geotrack/sdk

Démarrage rapide

import { GeoTrackClient } from '@geotrack/sdk'

const client = new GeoTrackClient({ apiKey: 'gt_votre_cle_api' })

// Lister les véhicules en ligne
const devices = await client.devices.list({ isOnline: true })
console.log(`${devices.total} véhicules en ligne`)

// Positions des dernières 24h
const now = new Date()
const positions = await client.devices.getPositions(devices.items[0].id, {
  fromDt: new Date(Date.now() - 86_400_000).toISOString(),
  toDt: now.toISOString(),
})
console.log(`${positions.length} positions récupérées`)

Ressources disponibles

Devices

// Lister avec filtres
const devices = await client.devices.list({ page: 1, pageSize: 50, isOnline: true })

// Détail d'un device
const device = await client.devices.get('uuid-du-device')

// Positions sur une plage
const positions = await client.devices.getPositions('uuid', { fromDt: '...', toDt: '...' })

// Résumé de trajets
const trips = await client.devices.getTripSummary('uuid', { fromDt: '...', toDt: '...' })

Alertes

// Lister les alertes récentes
const alerts = await client.alerts.list({ page: 1, alertType: 'overspeed' })

// Marquer comme lue
await client.alerts.acknowledge('alert-uuid')

Géofences

// Lister les géofences
const geofences = await client.geofences.list()

// Créer une géofence circulaire
const zone = await client.geofences.create({
  name: 'Dépôt principal',
  type: 'circle',
  lat: 6.1375,
  lng: 1.2123,
  radius: 500,
})

Colis (Last-Mile)

// Créer un colis
const parcel = await client.parcels.create({
  trackingCode: 'TRACK-001',
  recipientName: 'Jean Dupont',
  recipientPhone: '+22891000000',
  destinationAddress: 'Lomé, Togo',
})

// Mettre à jour le statut
await client.parcels.updateStatus(parcel.id, 'out_for_delivery')

// Lister par statut
const parcels = await client.parcels.list({ status: 'pending' })

Gestion des erreurs

import { GeoTrackError, GeoTrackAuthError, GeoTrackRateLimitError, GeoTrackNotFoundError } from '@geotrack/sdk'

try {
  const device = await client.devices.get('uuid-invalide')
} catch (error) {
  if (error instanceof GeoTrackNotFoundError) {
    console.log('Device introuvable')
  } else if (error instanceof GeoTrackRateLimitError) {
    console.log(`Rate limit — réessayer dans ${error.retryAfter}s`)
  } else if (error instanceof GeoTrackAuthError) {
    console.log('Clé API invalide')
  } else if (error instanceof GeoTrackError) {
    console.log(`Erreur API : ${error.message}`)
  }
}

Auto-hébergement

const client = new GeoTrackClient({
  apiKey: 'gt_...',
  baseUrl: 'https://votre-instance.com/api/v1',
})

TypeScript

Le SDK est entièrement typé. Tous les types sont exportés :

import type { Device, Position, Alert, Geofence, Parcel, Page } from '@geotrack/sdk'

Générer une clé API

  1. Connectez-vous sur geo.lsgrouptogo.com
  2. Paramètres → API Keys → Créer une clé
  3. Copiez la clé (affichée une seule fois)

Liens

Licence

MIT — voir LICENSE