Skip to main content
@voyant-travel/connect-sdk is the public TypeScript client for the Voyant Connect product. It wraps the operator and connection control plane plus the Connect-normalized data plane for inventory, bookings, and flights. Use it from non-Voyant apps and low-level tools. If you are building a Voyant operator app that should pull Connect inventory into the framework catalog, use @voyant-travel/connect-adapter instead.

Install

pnpm add @voyant-travel/connect-sdk

Create a client

import { createVoyantConnectClient } from "@voyant-travel/connect-sdk";

const client = createVoyantConnectClient({
  apiKey: process.env.VOYANT_API_KEY!,
  operatorId: "op_123",
});
The client-level operatorId is the default scope for operator-scoped calls. Any call accepts a per-call { operatorId } override.

Control plane

The control plane manages operators, connections, and everything around them:
// Create an operator
const operator = await client.operators.create({
  slug: "alpine-tours",
  name: "Alpine Tours",
  contactEmail: "ops@alpine.example",
});

// Add a connection to a supplier
const connection = await client.connections.create(operator.id, {
  supplierName: "Alpine Adventures",
  providerKey: "tui",
});
The control-plane groups:
GroupResponsibility
oauthExchange client credentials for a short-lived bearer token.
operatorsCRUD plus per-operator usage and search projections.
connectorProvidersList providers, manage applications and per-operator registrations.
connectionsCRUD plus webhook secret rotation, projection syncs, webhook and health events, and request logs.
linksPartner relationships and per-link capability toggles.
oauthClientsProvision and revoke machine-to-machine client credentials.
grantsIssue, update, revoke, and inspect access grants.
auditLogsPaginated organization-wide audit trail.
inviteTokensCreate, revoke, look up, and redeem invite tokens.
webhookSubscriptionsCreate, list, update, delete, test, and replay webhook deliveries.
customConnectionRequestsCapture inbound requests for new supplier integrations.

Data plane

The data plane returns Connect-normalized inventory. Cross-connection reads aggregate across every connection in an operator’s catalog:
await client.products.list();                          // all connections
await client.products.list({ providerKey: "ventrata" }); // filter by provider
await client.products.list({ connectionId: ["conn_a", "conn_b"] }); // multiple

const onConn = await client.products.listOnConnection(connection.id);
products.list, suppliers.list, and bookings.listAll aggregate across connections. Both connectionId and providerKey accept a scalar or an array. The data-plane groups:
GroupMethods
productslist, get, listOnConnection, getOnConnection, listOptions, listExtras
optionslistUnits, listExtraConfigs
supplierslist, listOnConnection
availabilitylist, calendar
bookingslistAll, list, get, create, confirm, cancel, listActivities
cruiseslistSailingPricing, listSailingPromotions
healthget (per-connection sync status)

Flights

The flights group covers the full air lifecycle: search, searchStream, searchOnConnection, price, book, getOrder, cancelOrder, ticketOrder, getSeatMap, selectSeats, getAncillaries, addAncillary, checkIn, exchange, refund, voidOrder, and addServiceRequest. flights.searchStream returns the raw Response so you can stream Server-Sent Events yourself. Each connection-result event corresponds to one provider settling, and the final event carries the merged, paginated response.

Authentication

  • A static API key in Authorization: Bearer <key> is the default.
  • For machine-to-machine flows, exchange OAuth client credentials for a short-lived bearer token with client.oauth.issueToken({ ... }). The response is the raw OAuth shape: access_token, expires_in, scope.
  • Both flows hit the same scope-checked routes; the token’s scope claim must include the scope a route declares.

Idempotency

bookings.create accepts { idempotencyKey }, sent as the Idempotency-Key header and replayed against the server-side dedupe table. Always pass one when creating bookings so retries do not double-book.
await client.bookings.create(connection.id, input, {
  idempotencyKey: "booking-attempt-7f3a",
});

Next steps

Connect adapter

Pull this inventory into a Voyant app’s catalog.

Concepts

Operators, connections, grants, and supply models.