Connectum API Reference / @connectum/core / createCatalogClient
Function: createCatalogClient()
createCatalogClient(
options):CatalogClient
Defined in: packages/core/src/catalogClient.ts:108
Build a standalone CatalogClient from a ServiceCatalog and a RemoteResolver.
Parameters
options
Returns
Example
ts
import { createCatalogClient, mapResolver } from "@connectum/core";
import { serviceCatalog } from "./gen/catalog.ts"; // @connectum/protoc-gen-catalog
const client = createCatalogClient({
catalog: serviceCatalog,
resolver: mapResolver({
"fleet.v1.FleetService": createGrpcTransport({ baseUrl: process.env.FLEET_ADDR }),
}),
});
// Fully typed off the generated catalog — same surface as ctx.call:
const trip = await client.call("trip.v1.TripService/StartTrip", { vehicleId });