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

@geog-ai/sdk

v0.1.1

Published

Official TypeScript / JavaScript stub client for the geog.ai Spatial Intelligence API.

Readme

@geog-ai/sdk (TypeScript)

Stub client for the geog.ai Spatial Intelligence API. Generated from openapi.yaml (v1). All 28 documented endpoints are exposed as typed methods on a single GeogClient.

Stub status. Method signatures cover every documented path and method. Request bodies for /simulate/*, /optimize/*, /rf/*, /trajectory/predict are typed as Record<string, unknown> for now — refine to your needs or regenerate from the OpenAPI spec when stricter types are required.

Install

npm install @geog-ai/sdk
# or
pnpm add @geog-ai/sdk
# or
yarn add @geog-ai/sdk

Requires Node ≥ 18 (uses the global fetch). For older runtimes, pass a fetch implementation in the constructor options.

Usage

import { GeogClient } from "@geog-ai/sdk";

const geog = new GeogClient({ apiKey: process.env.GEOG_API_KEY! });

// 1. Resolve spatial context for a registered device
const ctx = await geog.context({ device_id: "sensor_h2s_023" });

// 2. Run an async plume simulation
const job = await geog.simulatePlume({
  source: { lat: 31.9642, lon: -99.9035, alt_m: 545, emission_rate_gs: 2.4, stack_height_m: 12 },
  duration_min: 60,
  tier: 1,
  species: "H2S",
});

// 3. Wait for completion
const result = await geog.waitForJob(job.job.id);
console.log(result.result);

Async-job polling (typed result)

/simulate/*, /rf/mesh/viability, /rf/optimize/placement and /optimize/* return the same AsyncJobAccepted envelope (HTTP 202) — just an acknowledgement with a job.id. The actual payload lands at GET /jobs/{job_id}, typed as JobResponse<TResult>. Pass the result generic so result is typed instead of unknown:

import { GeogClient, type JobResponse } from "@geog-ai/sdk";

interface PlumeResult {
  contours: Array<{ ppb: number; geometry: unknown }>;
  peak_ppb: number;
  impacted_receptor_ids: string[];
}

const geog = new GeogClient({ apiKey: process.env.GEOG_API_KEY! });

// 1. Submit — 202 AsyncJobAccepted, no `result` yet
const accepted = await geog.simulatePlume({ /* … */ });

// 2. Poll until terminal state, with a typed generic
const done: JobResponse<PlumeResult> =
  await geog.waitForJob<PlumeResult>(accepted.job.id, {
    intervalMs: 2000,
    timeoutMs: 5 * 60_000,
  });

// 3. Narrow on status before reading the result
if (done.job.status === "complete" && done.result) {
  console.log(done.result.peak_ppb, done.result.impacted_receptor_ids);
} else {
  throw new Error(`Job ${accepted.job.id} failed`);
}

// One-shot snapshot (no polling loop):
const snapshot = await geog.job<PlumeResult>(accepted.job.id);

Swap PlumeResult for FloodResult, RFCoverageResult, MeshViabilityResult, NodePlacementResult, etc. — the SDK shape is the same; only your generic changes per endpoint.

Two envelopes, not one. AsyncJobAccepted (returned immediately by the submit call) only carries { ok, job: { id, status, eta_seconds, … } } — no result. The eventual JobResponse<TResult> from GET /jobs/{id} only populates result when job.status === "complete"; on "failed" inspect job.error / meta.

Errors

Non-2xx responses throw a GeogApiError with status, code, message, optional details, and requestId.

Regenerating types from the spec

The primitive request/response shapes (Location, WindVector, SpatialState, AsyncJobResponse, etc.) live in src/openapi.gen.ts, which is auto-generated from QHPA/marketing/geog/docs/openapi.yaml by openapi-typescript. The hand-written src/types.ts re-exports these shapes under public aliases and adds curated request envelopes for endpoints whose query/body shapes are not modelled as named schemas in the spec.

After editing the spec, regenerate with either:

# from this directory
npm run generate-types

# or from the repo root, regenerates both SDKs in one shot
bash QHPA/marketing/geog/docs/sdks/scripts/generate-types.sh

src/openapi.gen.ts carries an auto-generated — do not edit header. Treat it as build output: never hand-edit it; change the spec and rerun the script.

License

Proprietary — © geog.ai. Contact [email protected].