Create a new HonuaClient.
Connection, auth, transport, retry, and interceptor configuration.
See HonuaClientOptions for every field and @example blocks for common shapes.
Static ReadonlyminimumStatic ReadonlyminimumThe minimum Honua server version this SDK is contractually tested against.
Normalized base URL the client was constructed with (trailing slashes
trimmed). Helpers that build absolute URLs without going through
request() (e.g. tile URL generators) read this so they produce the
same origin and base path the server actually serves from.
OptionalextraOptionalresponseOptionalsignal?: AbortSignalProbe the server's compatibility contract and return a structured pass/fail status.
Unlike HonuaClient.getCompatibility, this method does not throw on transport
or parse failures — those are reported as supported: false with a human-readable
reasons entry. Use this at app startup to fail loudly before exercising admin or
control-plane flows.
Construct a typed wrapper for a single FeatureServer layer.
The returned HonuaFeatureLayer carries the same serviceId / layerId
on every call so you can write await layer.queryFeatures({ where: "..." })
without restating the address.
Fetch a single WMTS tile. mode selects between KVP
(?REQUEST=GetTile&...) and the RESTful path
(/{layer}/{style}/{tms}/{z}/{y}/{x}.{ext}). honua-server
advertises both; the SDK defaults to RESTful because the wire path
is a single string substitution per tile and skips
URLSearchParams serialisation on the hot path.
OptionaltaskName: stringOptionaltaskName: stringResolve the auth headers the client would attach to an outgoing request right now, refreshing provider credentials first if they are expiring.
Transports that build their own connection outside the REST/gRPC pipeline — notably realtime SSE streams, which must re-authenticate on every (re)connect so a refreshed token is picked up after a drop — call this per connect to obtain fresh credentials. Returns an empty object when no credentials are configured.
Resolve just the current bearer/authorization token value (without the
Bearer scheme prefix when a plain bearer token is configured), or
undefined if none. Convenience for realtime transports that must carry the
token as a query parameter (native EventSource cannot set headers).
Fetch and parse the server's compatibility contract from GET /api/v1/admin/capabilities.
The first call populates an in-process cache; subsequent calls return the cached value
unless options.refresh is true. Use HonuaClient.checkCompatibility instead
when you want a non-throwing pass/fail signal with a list of reasons.
HonuaError when the server response cannot be parsed into a valid
compatibility envelope (missing serverVersion, controlPlaneApi, etc.).
OptionalextraOptionalresponseOptionalsignal?: AbortSignalOptionalextraOptionalresponseOptionalsignal?: AbortSignalOptionalextraOptionalresponseOptionalsignal?: AbortSignalFetch and parse a WMS GetCapabilities document for the addressed
service. The XML body decodes through requestText; the parsed
shape is the typed WmsCapabilities envelope (no XML node leaks
through the public surface).
OptionalextraOptionalsignal?: AbortSignalOptionalversion?: stringIssue a WMS GetFeatureInfo. When INFO_FORMAT=application/json
the JSON body decodes into the canonical HonuaTypedFeature[]
shape; non-JSON formats round-trip on bytes so callers retain the
raw payload behind the protocol escape hatch.
Fetch a WMS GetLegendGraphic. honua-server does not implement
GetLegendGraphic today; callers should branch on
WmsCapabilities.request.getLegendGraphic before invoking. When
the wire returns 5xx the underlying HonuaHttpError flows through.
Render a WMS GetMap. Returns the raw image bytes.
Optionalsignal?: AbortSignalWMTS GetFeatureInfo. honua-server accepts both KVP and RESTful
routing; mode default mirrors fetchWmtsTile.
OptionalbaseConstruct the OGC API Features client wrapper.
Use this to walk collections (landing(), conformance(), collections()),
read items (items(), item()), and apply edits (create* / replace* /
patch* / delete*) against an OGC API Features endpoint exposed by the
Honua server.
Pipeline-aware request that returns the raw Response after the
shared auth / retry / timeout / interceptor pipeline finishes
successfully. Used by adapters that need to consume non-JSON bodies
(OData $metadata XML, raw passthrough) without inheriting the
Accept: application/json default of pipelineRequestJson.
The returned Response is unconsumed — the caller picks .json(),
.text(), or .arrayBuffer(). Non-2xx responses still throw the
normalized HonuaHttpError (and trigger retries) so error handling
matches every other client method.
Optionalinit: RequestInitOptionalcallerSignal: AbortSignalOptionalokPipeline-aware JSON request that bypasses the GeoServices f=json
convention used by request. Adapters whose protocols do not
model f= (OData, OGC API, …) call this directly so they keep the
shared auth / retry / timeout / interceptor pipeline without sending
a query parameter the server would reject as InvalidQueryOption.
Caller-supplied query parameters belong on path itself; init
carries the body, headers, and abort signal. The default Accept
header is application/json; pass an explicit Accept in
init.headers to override.
Optionalinit: { Optionalbody?: null | BodyInitOptionalheaders?: HeadersInitOptionalsignal: AbortSignalRun a GeoServices FeatureServer/query request against a Honua-hosted layer.
This is the canonical low-level read path. It maps directly to the FeatureServer
query endpoint and accepts the full ArcGIS query shape (where, outFields,
geometry, spatialRel, orderByFields, resultRecordCount, outSr, ...).
For cross-protocol code (OGC, WFS, OData, STAC), prefer the protocol-neutral
createDataset contract — it normalizes capability differences and gives
you Source.query(...) plus paginated Source.queryAll(...) with explicit
exceededTransferLimit reporting.
const { features, exceededTransferLimit } = await client.queryFeatures({
serviceId: "parcels",
layerId: 0,
where: "STATUS = 'ACTIVE'",
outFields: ["OBJECTID", "NAME"],
returnGeometry: true,
outSr: 4326,
resultRecordCount: 500,
});
if (exceededTransferLimit) {
// re-issue with `resultOffset` or use queryFeaturesStream / dataset.source().queryAll()
}
Drive a paginated FeatureServer query as an async generator. Each yielded
chunk is a HonuaFeature[] slice; iteration stops when the server stops
advertising exceededTransferLimit. Lower-level than
dataset.source(...).queryAll() but suitable for streaming pipelines that
want backpressure between pages.
Force-refresh credentials from the configured auth provider. The SDK keeps the result in memory only; callers own durable and secure storage.
Fetch a text response (e.g. XML / JSON / plain) with an explicit Accept
negotiation. Used by the WFS adapter for GetCapabilities,
Transaction responses, and ExceptionReport bodies, and by the
WMS / WMTS Capabilities pipelines. Routes through the same
interceptor / retry / abort pipeline as requestJson /
requestBytes, so adapter callers do not need to bypass HonuaClient
to reach fetch directly.
Optionaloptions: { Optionalaccept?: stringOptionalbody?: BodyInitOptionalcontentOptionalsignal?: AbortSignalResolve (and memoize) the OGC API Features endpoint layout for the
given discovery mode. honua-facade (default) returns the fixed
/ogc/features/... fast path with no network access; ogc-api and
auto discover the layout from the server's landing page per OGC API
baseUrl).Revoke the currently cached credentials through the provider, when it exposes a revocation hook, then clear the SDK's in-memory cache.
Scan a supported migration source through the admin import scanner.
A successful HTTP response means the server returned a deterministic
inventory artifact; callers still need to inspect
scanCompleteness.status, which can be "failed" on 200 OK.
Returns true if the server's data.compatibility.features map advertises the
given coarse capability. Use this to gate experimental or admin-only workflows.
The main Honua HTTP/gRPC-Web client.
HonuaClientis the protocol-aware entry point into the Honua server. It speaks GeoServices (FeatureServer, MapServer, ImageServer, GeometryServer, GPServer), OGC API Features / Tiles / Maps / Processes, STAC, WMS, WMTS, WFS 2.0, and OData v4, with one consistent request/response shape, capability negotiation, optional retries, pluggable auth, and a small in-process metadata cache.For cross-protocol code that does not need to know the underlying service shape, prefer the protocol-neutral createDataset contract from
@honua/sdk-js/contract— it wraps this client and exposes a singleSource.query(...)surface that throws HonuaCapabilityNotSupportedError when a protocol cannot satisfy the request.Example: Basic usage
Example: Per-service fluent wrappers