OptionalapiStatic API key sent as X-API-Key. Prefer auth for refreshable credentials.
OptionalauthOptional credential provider. The SDK calls it lazily, caches returned
credentials until expiresAt nears, and never persists secrets itself.
Returning a string is shorthand for { bearerToken: string }.
OptionalauthMilliseconds before expiresAt when credentials should be refreshed. Default: 60 seconds.
Absolute origin of the Honua server (e.g. https://api.honua.example).
Trailing slashes are normalized.
OptionalbearerStatic bearer token sent as Authorization: Bearer <token>. Prefer auth for refreshable credentials.
OptionalfetchOverride the global fetch implementation (useful in Node before built-in fetch, or for testing).
Optionalinit: RequestInitOptionalinit: RequestInitOptionalinterceptorsPer-request before / after / error hooks invoked on every HTTP call.
OptionalpreferWhen true, query methods use f=pbf for binary protobuf responses
and decode them transparently into the same JSON-compatible shape.
Falls back to f=json on decode failure. Default: false.
OptionalretryRetry strategy for transient failures.
Applies to both the REST and "grpc-web" transports. On gRPC-web the same
policy is applied to replay-safe unary calls only: transient gRPC
status codes (resource_exhausted, unavailable, deadline_exceeded,
aborted) are retried with the same exponential backoff + jitter and
retry-after handling as REST, and never past the abort/timeoutMs
deadline. Server-streaming calls are not retried (they cannot be safely
replayed mid-iteration).
OptionaltimeoutPer-request hard timeout in milliseconds. Independent of any caller-supplied AbortSignal.
OptionaltransportTransport protocol. "rest" uses JSON/PBF over HTTP (default).
"grpc-web" uses typed RPC via Connect gRPC-Web transport.
Configuration passed to the HonuaClient constructor.
Example: Minimal config
Example: With API key + retries
Example: With an OAuth-style credential provider