Installing the Honua JavaScript SDK
Native application path: gRPC for live data and edits; PMTiles, GeoParquet and COG through the CDN. Start there for browser gRPC-Web setup, signed private URLs and regeneration after changes. OGC API and GeoServices REST examples below are compatibility workflows.
The Honua JavaScript SDK ships as a single npm package — @honua/sdk-js — with multiple
subpath entrypoints. The core client, the client compatibility layer, the migration helpers,
and the protocol-neutral contract are all reachable from this one install.
Generated support status
The versioned source of truth is config/support-manifest.v1.json.
It projects 22 supported (documented below as stable), 29 experimental,
and 0 deprecated package entrypoints. Protocol status is independent
of package lifecycle: raw endpoint support, facade requirements, execution mode, and
evidence are listed in the generated
backend-agnostic capability matrix. The generic
support projection carries explicit contracts
for both honua.io and the canonical samples/catalog.v2.json inventory.
The reviewed package-root ceilings are 47 runtime
exports and 181 declaration exports. The exact inventory
and generated migration table come from
config/root-surface.json. This guide tracks the
current development branch; its package baseline can match the latest release
while the branch contains unreleased work. Use the
tagged release documentation for the
published artifact.
Which import
A new 2D map imports createHonua from @honua/sdk-js and maplibreRenderer from @honua/sdk-js/runtime. Server attach uses HonuaClient from @honua/sdk-js/honua. An ArcGIS app uses @honua/sdk-client-compat and @honua/honua-migrate. Widget paint registers @honua/app-platform/web-components. @honua/sdk is HonuaClient, not createHonua.
Stable subpath entrypoints
While the SDK is on 0.x, a minor may still change a stable symbol, only as a
reviewed, called-out change. Symbols marked @experimental may change in any
minor. At 1.0 the stable tier freezes. See
docs/decisions/scope-split-and-1.0.md.
| Subpath | What it gives you |
|---|---|
@honua/sdk-js |
Reviewed common connect → query → explain → mount surface (exact inventory) |
@honua/sdk-js/browser |
Prebuilt browser ESM build of the default barrel (same API as @honua/sdk-js) |
@honua/sdk-js/honua |
HonuaClient (the raw GeoServices/OGC client) |
@honua/sdk-js/auth |
OAuth2/PKCE, client credentials, static providers, and credential stores |
@honua/sdk-js/contract |
Protocol-neutral Dataset / Source / Query / Result + createDataset |
@honua/sdk-js/client-compat |
Drop-in compatibility classes (FeatureLayerCompat, MapViewCompat, …) for migrating existing GeoServices web apps |
@honua/sdk-js/migration |
Forwards to @honua/honua-migrate. src/migration/codemod.ts is the in-repo suite, not the npm program. |
@honua/sdk-js/runtime |
MapLibre map document runtime (loadMapDocument, HonuaMapRuntime) |
@honua/sdk-js/expr |
Honua expression builder |
@honua/sdk-js/webmap |
WebMap JSON load/save helpers |
@honua/sdk-js/geocoding |
Geocoding adapters |
@honua/sdk-js/exploration |
Linked-view exploration state + presets |
@honua/sdk-js/interactions |
Hit-test + pointer normalization + chart/map bindings |
@honua/sdk-js/filter-registry |
Shared filter clause registry + projections |
@honua/sdk-js/style |
Honua style spec + source parsers/validators |
@honua/sdk-js/map |
HonuaMap programmatic map container |
@honua/sdk-js/realtime |
Realtime transport adapters (SSE) — a client-transport primitive |
@honua/sdk-js/react |
React provider, hooks, and map components (optional react / react-dom peers; published standalone as @honua/react) |
@honua/sdk-js/geometry |
Curated turf/proj4 client-side geometry ops (buffer/area/simplify/reproject) |
@honua/sdk-js/cli |
Programmatic run() entrypoint for the honua command-line client |
@honua/sdk-js/agent-tools |
Agent-facing JSON Schema tool definitions and the bounded tool executor (MCP/OpenAI compatible); the in-repo @honua/mcp-server consumes it. See the agent-safety threat model. |
@honua/sdk-js/agent-safety |
Bounded runtime validation, effect budgets, signed approval envelopes, authenticated single-use consumption, context revalidation, and deterministic execution-receipt verification for JSON-compatible plans (threat model). |
Experimental subpath entrypoints
Subpaths marked @experimental in JSDoc. Useful today; the shape may change in
any minor release prior to 1.0.0. The stable root promotes a reviewed
query-planner subset: explainQuery, executeQueryPlan, hashQueryPlan, the
plan errors/version constants, and the types required to name the common
explain/mount workflow. The complete @honua/sdk-js/query-planner subpath
remains experimental. Every other experimental subpath is subpath-only and is
not re-exported from @honua/sdk-js or @honua/sdk-js/honua.
| Subpath | What it gives you |
|---|---|
@honua/sdk-js/grpc-web |
Browser-bundleable native HonuaClient; install the optional Buf/Connect peers before importing (native conversion guide). |
@honua/sdk-js/cog |
Evidence-bound static-STAC COG inspection, bounded overview/window reads, and an opt-in viewport-driven MapLibre image source through caller-injected decoder/renderer peers; neither peer enters the root graph (guide). |
@honua/sdk-js/pmtiles |
Authenticated bounded archive inspection plus experimental Honua archive/publish jobs, status/cancellation, strict public/signed/range-proxy descriptors, and truthful cleanup dispositions (guide). |
@honua/sdk-js/export |
Open an Export: a Portolan STAC collection (pinned v0.3.0) of PMTiles + GeoParquet files, with any collection drawn through its visual or data asset and read without HEAD requests at the recorded file:size; on a Honua Export (honua: extension), plus the paired publication descriptor v1, identity lookups through a small bundled Parquet reader that prunes row groups by statistics and bloom filters, selection through the stable feature identity, CSV/GeoJSON export and attribute queries of public fields through the DuckDB peer (loaded only when such a query runs), and a lookup budget with live-service fallback. |
@honua/sdk-js/stac |
Experimental dynamic STAC search, bounded pagination, signed asset refresh, and typed handoffs to the canonical COG, PMTiles, columnar, and runtime entrypoints (walkthrough). |
@honua/sdk-js/raster |
Experimental bounded raster sessions across dynamic-STAC/direct COG, ImageServer, OGC API Coverages, and WCS, with explicit band/range semantics and MapLibre/deck.gl presentation handoffs (capability matrix). |
@honua/sdk-js/coverages |
Bounded OGC API Coverages and WCS 2.0.1 discovery, domain/range metadata, subset downloads, typed OWS errors, and an opt-in MapLibre image projection (guide). |
@honua/sdk-js/zarr |
Experimental Honua Server /api/v1 Zarr registration and metadata inspection, a byte-bounded datacube PNG tile handoff, and a bounded direct reader for reviewed static or object-store chunks. The server facade does not read object stores itself (guide). |
@honua/sdk-js/geoparquet |
GeoParquet / DuckDB-WASM–backed protocol-neutral Source; the optional DuckDB peer loads lazily. |
@honua/sdk-js/geoparquet/node |
Native Node DuckDB factory for local and HTTP GeoParquet; requires the optional @duckdb/node-api peer (guide). |
@honua/sdk-js/columnar-workflow |
Bounded GeoParquet inspection and query planning plus Honua Arrow and Parquet feature-query workflows, with explicit decoder, memory, transfer, and handoff limits (guide). |
@honua/sdk-js/query-planner |
Deterministic query IR, side-effect-free explain plans, GeoServices compilation, and explicitly bounded local execution. |
@honua/sdk-js/source-schema |
Focused experimental SourceSchemaV2 validation, GeoServices/OData/GeoParquet/WMS/WMTS normalization, and one-pass opt-in connectWithSourceSchemaV2() discovery. |
@honua/sdk-js/source-capabilities |
SourceSchemaV2-bound static evidence/CRS validation plus lightweight claimed/observed/effective evaluation, current-source cache checks, bounded strict transport, and dynamic policy/peer/authorization gates; serialized caller data remains potentially sensitive (guide). |
@honua/sdk-js/source-capability-discovery |
Focused GeoServices/OData/WMS/WMTS connectWithSourceCapabilities() integration with canonical descriptor replay binding and fresh policy/environment/peer/authorization evaluation. |
@honua/sdk-js/cloud-native-discovery |
Normalized, bounded capability discovery for COG, STAC, PMTiles, GeoParquet, Zarr, and NetCDF sources, with explicit client/server/end-to-end maturity and no executable claims for metadata-only formats. |
@honua/sdk-js/plugin |
Versioned, data-only plugin manifests plus deterministic compatibility and authority-boundary certification reports. |
@honua/sdk-js/pmtiles-protocol-plugin.js |
The first-party PMTiles ProtocolModule packaged as a certifiable HonuaPluginFactory<"protocol"> — the manifest-advertised plugin entrypoint, resolvable as a package export. |
@honua/sdk-js/deckgl |
Bounded, zero-copy typed-array projection into an optional deck.gl peer, with stable picking identity and deterministic disposal. |
@honua/sdk-js/kepler |
Optional Kepler.gl workspace bridge: explicit ingestion mappings that avoid a GeoJSON round trip for tabular/point/columnar results, preserved provenance and CRS decisions, a declared linked-state channel table, bounded delta reconciliation, and credential redaction on export. |
@honua/sdk-js/analytics |
Versioned linked-analytics and chart presentation contract: accepted category/histogram/aggregate/time-series artifacts with units, null policy, ordering, and pushdown provenance; deterministic mark/brush sync with shared exploration state; and a small accessible default presentation (guide). Carries no chart adapters, so unused chart peers cost nothing. |
@honua/sdk-js/analytics/uplot |
Reference third-party chart adapter over the optional µPlot peer, loaded only through a dynamic import at mount time. Proves the analytics contract against a real library (guide). |
@honua/sdk-js/offline |
Versioned downloadable-region manifests plus storage-neutral quota, integrity, cancellation, and atomic commit contracts. |
@honua/sdk-js/diagnostics |
Dependency-free diagnostic-bundle validation, sanitization, integrity pinning, and bounded read-only replay used by honua doctor. |
@honua/sdk-js/nl-map-control |
Natural-language map control (safety model + walkthrough): compiles NL instructions into serializable, inspectable plans (query-planner IR + agent-tool invocations) via a caller-provided LLM callback; execution accepts plans only, gates mutations behind agent-safety envelopes, and emits receipts. |
@honua/sdk-js/routing |
Provider-pluggable routing: typed RoutingProvider contract, OSRM and Valhalla adapters, the Honua facade bridge, and per-provider attribution/usage-policy metadata (provider cookbook). |
@honua/sdk-js/interactions/declarative |
Compiles a standard interactions[] block (geospatial-mcp ADR-0030) onto the imperative binding primitives in /interactions: closed event/verb sets, $event.*-only argument substitution, a per-(ref, event) fan-out cap, actions that never emit events, and typed unsupported results naming any pair this runtime cannot honor. |
@honua/sdk-js/studio-agent |
The agent session behind a prompt-to-map Studio: streams honua-server's provider-neutral AI proxy over SSE, dispatches the model's tool calls across two planes (local /agent-tools verbs through an AI map kit, honua_studio_* composition tools through a dependency-free MCP client) on one serialized queue with a single generation-conflict reload+retry, and never throws mid-stream. |
@honua/sdk-js/local-install |
Node-only, manifest-pinned local Docker installer shared by honua admin install local and the bootstrap MCP tool; fails closed when the release image does not match the generated Admin API contract. Mints the honua-local-agent key with LOCAL_AGENT_GRANTS (admin:read, admin:write, read:*) and re-issues a legacy two-grant key on re-run (credentialReissued, reason: "legacy-grants"). |
Deprecated compatibility entrypoints
None. 0.4.0 removed the eighteen @honua/sdk-js application-platform
forwarders (/app, /app-workspace, /control-plane, /web-components and
the rest); import each surface from @honua/app-platform/<subpath>, listed below.
Application-platform entrypoints (@honua/app-platform)
App-shell, app-builder, and hosted-product surfaces have moved out of the client
SDK into the separate @honua/app-platform package, which versions at its
own pre-1.0 cadence so @honua/sdk-js can reach a frozen 1.0 without waiting on
them (see docs/decisions/scope-split-and-1.0.md).
@honua/app-platform subpath |
What it gives you |
|---|---|
@honua/app-platform/app |
App bootstrap helper for browser shells |
@honua/app-platform/app-controller |
HonuaController — renderer-neutral app controller |
@honua/app-platform/app-workspace |
Framework-neutral workspace state orchestration |
@honua/app-platform/scene-workspace |
3D scene workspace + MapLibre/Cesium adapters (optional cesium peer) — beta; see the surface tiers table for the exports it covers and the ones still experimental |
@honua/app-platform/collaboration |
Saved-map collaboration client |
@honua/app-platform/control-plane |
Hosted-product / admin client |
@honua/app-platform/replica-sync |
Offline-replica sync client |
@honua/app-platform/share |
Embed-token + DCAT sharing helpers |
@honua/app-platform/operate |
Operations/observability client |
@honua/app-platform/generated-app |
Manifest projection + preview runtime for generated apps |
@honua/app-platform/studio |
Studio package-family projections, validation/preview envelopes, capability manifest, publish/share/embed contracts (MCP/QGIS-safe) |
@honua/app-platform/controls |
Native UI control kit (<honua-basemap-switcher>) for MapLibre maps |
@honua/app-platform/web-components |
Framework-neutral custom elements |
@honua/app-platform/operator |
Operator-native chat/plan-review/approval controllers |
@honua/app-platform/operator/controllers |
Framework-neutral controllers behind /operator |
@honua/app-platform/operator/workspace |
Operator workspace state container |
@honua/app-platform/operator/theming |
Operator design-system theme provider + tokens |
@honua/app-platform/operator/i18n |
Operator message catalog + resolution |
@honua/sdk-js does not re-export these surfaces. The @honua/sdk-js/console
entrypoint was removed earlier (its projection helpers are owned by the
@honua/console application).
Pass an @honua/sdk-js source to @honua/app-platform
Each package ships its own copy of the contract types, so TypeScript rejects a
source from @honua/sdk-js (or @honua/sdk) where an app-platform component
expects a Source: the typed protocol() and adapter() results come from two
separate adapter maps. Pass the source through adoptHonuaSdkSource. It returns
the same object, and the compiler still checks every other member:
import { adoptHonuaSdkSource, createHonuaApplicationContext } from "@honua/app-platform/web-components";
import { connect } from "@honua/sdk-js/honua";
const connection = await connect({ endpoint, protocol: "geoservices-feature-service", authorizationScopeFingerprint });
const source = adoptHonuaSdkSource(connection.source());
createHonuaApplicationContext({ status: "ready", binding: { source, sourceIdentity: source.descriptor.id } });
createHonuaFeatureTable takes only the query surface and accepts an SDK
source directly. Use the helper instead of an as unknown as cast. The
objects protocol() and adapter() return are still @honua/sdk-js adapter
instances, so do not test them with instanceof against app-platform classes.
Prerequisites
- Node.js 22.12 or later
- A Honua Server instance only for capabilities marked
facade-required; standalone protocol clients do not require one
Install
npm install @honua/sdk-js
Optional peer dependencies
A few integration paths are gated behind optional peer dependencies so a Node-only or REST-only consumer never pays the install cost:
| Integration | Peer to install |
|---|---|
MapLibre map document runtime (@honua/sdk-js/runtime) |
6.4.1 or newer within major 6 (^6.4.1). Every SDK release since 0.1.12 declares this range and refuses affected 5.x and early 6.x peers; older published SDK metadata is unchanged. Requires WebGL2; see runtime support. |
deck.gl binary projection (@honua/sdk-js/deckgl) |
npm install @deck.gl/layers |
Kepler.gl workspace bridge (@honua/sdk-js/kepler) |
npm install @kepler.gl/actions (plus the Kepler UI packages your app renders) |
Cesium 3D adapters (@honua/app-platform/scene-workspace) |
npm install cesium |
gRPC-Web transport (new HonuaClient({ transport: "grpc-web" })) |
npm install @connectrpc/connect @connectrpc/connect-web @bufbuild/protobuf |
Geometry ops (@honua/sdk-js/geometry) |
npm install proj4 @turf/buffer @turf/area … (only the ops you import) — or use the @honua/geometry split package |
Migration API (@honua/sdk-js/migration) |
npm install typescript |
If you stay on the default REST transport with no MapLibre/Cesium scene work, no extra installs are required.
Quick Start
import { HonuaClient } from "@honua/sdk-js/honua";
const client = new HonuaClient({
baseUrl: "https://your-honua-server.com",
});
const compatibility = await client.checkCompatibility();
if (!compatibility.supported) {
throw new Error(
`Unsupported Honua server. Minimum supported version: ${HonuaClient.minimumSupportedServerVersion}. ` +
`Reasons: ${compatibility.reasons.join("; ")}`,
);
}
const result = await client.queryFeatures({
serviceId: "natural-earth",
layerId: 0,
where: "1=1",
returnGeometry: true,
outFields: ["*"],
outSr: 4326,
resultRecordCount: 25,
});
const featureCount = result.features?.length ?? 0;
console.log(`Found ${featureCount} feature(s)`);
This quick start uses the raw GeoServices queryFeatures() request. Its where
member is GeoServices SQL and is not the deprecated, source-native
protocol-neutral Query.where compatibility member.
Use focused stable subpaths for advanced APIs. The generated
root import migration table maps every
symbol removed from the transition-era root to its supported replacement; the
machine-readable source is config/root-surface.json.
checkCompatibility() reads the parsed data.compatibility contract from
GET /api/v1/admin/capabilities. For a runnable browser example from this repo,
including the renderable-geometry checks used by the committed MapLibre quickstart,
see examples/maplibre-quickstart/README.md.
Canonical Contract And Exploration
The SDK exposes a protocol-neutral client contract and exploration state module that
wrap the existing HonuaFeatureLayer / HonuaMapService / HonuaOgcFeatureCollection
classes. These are reachable via the @honua/sdk-js/contract and
@honua/sdk-js/exploration subpaths:
docs/shared-client-contract.md—Dataset,Source,Capabilities,Query,Result,MapBinding, andcreateDataset(...).docs/exploration-context.md—createExplorationContext(...)with linked-view presets (globalLinked,mapDriven,gridDriven,chartDriven,decoupled).docs/protocol-capability-matrix.md— capability coverage per protocol (geoservices-feature-service,geoservices-map-service,geoservices-image-service,geoservices-geometry-service,geoservices-gp-service,ogc-features,ogc-tiles,ogc-maps,stac,wfs,wms,odata).docs/wfs.md— first-party WFS 2.0 adapter, FES filter translation, content-type negotiation, transactions, stored queries, and theSource.protocol("wfs")escape hatch.docs/source-binding-alignment.md— round-trip mapping betweenSourceDescriptorand the serverSourceBindingdocument.docs/maplibre-runtime.md—loadMapDocument(...)andHonuaMapRuntimefor the MapLibre GL JS-first map document runtime.
Migration Tooling
The standalone migration CLI is published as @honua/honua-migrate (npx honua-js-migrate).
@honua/sdk-js/migration forwards to that optional package when installed alongside the SDK;
src/migration/codemod.ts is the in-repo suite, not the npm program.
import * as migration from "@honua/sdk-js/migration";
// Install @honua/honua-migrate separately to invoke the programmatic migration helpers.
Version Policy
- Documentation version: Hosted guides and API entrypoints identify their exact SDK release. Use the generated documentation version selector for tagged archived guides, compatibility ranges, and migration links.
- Pre-release (
-alpha.*,-beta.*): Published to npm with@alpha/@betadist-tags. - Stable (
1.0.0+): Published to npm as@latest. - Semver: Releases follow Semantic Versioning. While the SDK is on
0.x, a minor may still change a stable symbol, only as a reviewed, called-out change. At 1.0, breaking or removing a stable symbol requires a major. Symbols marked@experimentalin JSDoc may change in any minor release. - Cross-language alignment: Major versions are coordinated across the Honua SDK family (JavaScript, Python, .NET) so a single semver line tells you what the contract is on every platform.
Advanced packaging. Downstream packagers can also produce the split packages, including
@honua/sdk(HonuaClient, notcreateHonua) and@honua/sdk-client-compat, vianpm run build:split-packages.@honua/honua-migrateis not one of those generated packages. This is an opt-in build target, not the default consumer install. Seedocs/split-packages.mdif you are integrating with a downstream registry that needs the smaller surfaces.
Maintainers can verify the artifact consumers actually install with
npm run verify:packed-sdk after the library and browser builds. The gate packs
the root package, installs it offline into an isolated ESM project, imports every
stable and experimental subpath, typechecks every shipped declaration target,
and runs the packaged honua --help command. Temporary package and consumer
directories are removed after both successful and failed runs.