Options for configuring the ApiClient.

interface ApiClientOptions {
    apiKey?: string;
    timeout?: number;
    transport?: Transport;
    url?: string;
}

Properties

apiKey?: string

API key, sent as x-api-key on every call. The gateway requires it on every non-health RPC when it enforces API-key auth, as the cluster ingress does.

timeout?: number

Optional timeout in milliseconds for RPC calls (default: 30000).

transport?: Transport

A ready-made transport instead of gRPC-Web on url. In Node, native gRPC reaches the gateway's gRPC port (HTTP/2) directly, the port the C# and Python clients use:

import { createGrpcTransport } from "@connectrpc/connect-node";
const transport = createGrpcTransport({
baseUrl: "https://api.virtufin.com:443",
interceptors: [apiKeyInterceptor(key)],
});
const client = new ApiClient({ transport });

Set the API key through the transport's interceptors, as above: apiKey cannot be added to a transport that is already built.

url?: string

The base URL of the gateway's gRPC-Web endpoint: an https:// URL for TLS (e.g. "https://api.virtufin.com" for the demo cluster), http:// for a plaintext local gateway's HTTP/1.1 port (e.g. "http://localhost:5001"). Required unless transport is given.