Skip to main content
@voyant-travel/connect-adapter is the integration layer for consuming Connect inventory inside a Voyant app. It adapts Connect’s normalized inventory into the framework catalog’s SourceAdapter contract, so Connect-sourced products show up in search, content, and booking flows right next to inventory you operate yourself. Use this package when a Voyant operator template should register Connect as a catalog source. The raw @voyant-travel/connect-sdk remains the right choice for non-Voyant consumers and low-level tools.

Install

pnpm add @voyant-travel/connect-adapter @voyant-travel/connect-sdk @voyant-travel/catalog

Register the adapter

Create an adapter from your Connect credentials and register it in the catalog’s source adapter registry, keyed by the connection it serves:
import { createSourceAdapterRegistry } from "@voyant-travel/catalog/booking-engine";
import { createVoyantConnectSourceAdapter } from "@voyant-travel/connect-adapter";

const registry = createSourceAdapterRegistry();

const adapter = createVoyantConnectSourceAdapter({
  connect: {
    apiKey: process.env.VOYANT_API_KEY!,
    operatorId: "op_123",
    baseUrl: "https://api.voyant.travel",
  },
});

registry.register("conn_123", adapter);

How discovery works

Discovery reads Connect search documents and emits catalog projections with stable provenance and field-policy-aligned keys such as name, source.kind, source.ref, seller.operator_id, thumbnailUrl, cruiseType, nights, and price_from, where Connect provides the underlying minor-unit money data. The source_connection_id is always populated, so quote, reserve, cancel, and status calls route back to the same Connect connection that produced the projection.

Routing bookings back to the source

Booking dispatch must reach the same connection that produced the quote. When wiring catalog booking routes, resolve the adapter context from the quote or sourced-row provenance instead of using the default context:
import { resolveVoyantConnectAdapterContext } from "@voyant-travel/connect-adapter";

const resolveAdapterContext = (input: {
  sourceKind?: string | null;
  sourceConnectionId?: string | null;
  correlationId?: string;
}) =>
  resolveVoyantConnectAdapterContext({
    sourceKind: input.sourceKind,
    sourceConnectionId: input.sourceConnectionId,
    correlationId: input.correlationId,
  });
The helper throws when sourceConnectionId is missing. That is intentional: quote, reserve, cancel, and reservation status must route to the connection that emitted the projection.

Rich content and live resolution

Rich content reads go through SourceAdapter.getContent. For cruises, the adapter resolves a Connect search-document id back to the cruise source ref and returns the Voyant cruises content shape (content_schema_version: "cruises/v1") with cruise, ship, sailings, cabin_categories, itinerary_stops, and policies. Live resolution uses Connect’s fresher routes rather than relying on stale search documents, selected with parameters.connectRoute:
InventoryRoute
Default productsclient.availability.list
Staysset parameters.connectRoute = "stays"
Cruisesset parameters.connectRoute = "cruises"
Apps with vertical-specific payloads can override liveResolve, reserve, cancel, or getContent while keeping the same SourceAdapter registration.

Next steps

Connect cruises

A dedicated cruises adapter boundary.

Catalog module

How the framework catalog consumes source adapters.