type: reference title: "Zarr client" description: "Experimental client for Honua Server's versioned Zarr registration and tile-serving contract, reusing an existing HonuaClient for auth, retries, timeouts and interceptors." resource: "honua://capability/raster.multidim-coverage"

Zarr client

@honua/sdk-js/zarr is an experimental client for Honua Server's versioned Zarr registration and tile-serving contract. It reuses an existing HonuaClient, so API keys, bearer tokens, cancellation, retry policy, timeout, and request interceptors remain active.

import { HonuaClient } from "@honua/sdk-js/honua";
import { createZarrClient } from "@honua/sdk-js/zarr";

const client = new HonuaClient({
  baseUrl: "https://your-honua-server.example",
  apiKey: process.env.HONUA_API_KEY,
});
const zarr = createZarrClient(client);

const registered = await zarr.register({
  layerId: 7,
  name: "Daily temperature",
  provider: "AwsS3",
  bucket: "coverage-data",
  rootPath: "temperature/daily.zarr",
});

const scanned = await zarr.refresh(registered.id);
// Supply the extent advertised by the associated layer/coverage metadata. The
// registration summary does not expose the scanned store extent itself.
const readiness = {
  storageExtent: [-180, -90, 180, 90] as const,
  tileMatrixSrid: 4326,
  variable: scanned.primaryVariable ?? undefined,
};
const status = zarr.assess(scanned, readiness);
if (status.serverTileHandoff !== "ready") {
  throw new Error(status.failures.map((failure) => failure.message).join("; "));
}

const tile = await zarr.tile({
  layerId: scanned.layerId,
  tileMatrixSetId: "WorldCRS84Quad",
  z: 3,
  x: 2,
  y: 4,
  variable: readiness.variable,
  datetime: "2026-08-13T00:00:00Z",
  maxResponseBytes: 2 * 1024 * 1024,
});

Contract and limits

HonuaZarrClient does not fetch chunks from S3, Azure Blob Storage, or the local filesystem. assess().directObjectStoreRead therefore remains "unavailable". Server tile execution stays on the versioned Honua route.

openDirectZarrStore is a separate reader for reviewed Zarr v2 and v3 layouts on static HTTP or object storage. It sends bounded Range requests for known metadata keys and the chunks that intersect an explicit window. Credentials are omitted, redirects are not followed, and an unsupported codec or layout fails after metadata discovery and before chunk transfer. The API remains experimental until cross-deployment evidence is stable.

import { openDirectZarrStore } from "@honua/sdk-js/zarr";

const store = openDirectZarrStore({
  url: "https://data.example/temperature.zarr",
  limits: { maxChunks: 64, maxPixels: 1_048_576 },
});
const inspection = await store.inspect();
const samples = await store.readWindow({
  pixel: { x: 0, y: 0, width: 64, height: 64 },
  bands: [1],
});
void inspection;
void samples;