Registry / api-client / sabre-rest

sabre-rest

JSON →
library0.14.0jsnpmunverified

A Sabre REST API client for Node.js, written in TypeScript (v0.14.0). Currently in early development (pre-1.0) with an unstable API surface. Requires Node.js 22+. Provides a programmatic client with OAuth v2 authentication and a built-in CLI for testing against Sabre's REST APIs (e.g., airline lookup, bargain finder max). Key differentiator: modern ESM/TypeScript native implementation with no dotenv dependency (uses Node's built-in process.loadEnvFile). Release cadence is irregular as the library is actively evolving.

npm install sabre-rest
INSTALL
IMPORT
SIG · SABRE-REST
S
sabre-rest
api-clientjavascriptv0.14.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

createSabreClient
import { createSabreClient } from 'sabre-rest'
const { createSabreClient } = require('sabre-rest')
ESM-only; CommonJS require() will fail. Use ESM imports.
createOAuthV2
import { createOAuthV2 } from 'sabre-rest'
import createOAuthV2 from 'sabre-rest'
Named export, not default export. Import via destructuring.
SabreBaseUrls
import { SabreBaseUrls } from 'sabre-rest'
An object with predefined base URLs (e.g., SabreBaseUrls.cert). Access as a constant.

Creates a Sabre REST client with OAuth v2 authentication using environment variables.

import { createSabreClient, createOAuthV2, SabreBaseUrls } from 'sabre-rest'; const client = createSabreClient({ baseUrl: SabreBaseUrls.cert, auth: createOAuthV2({ clientId: process.env.SABRE_CLIENT_ID!, // set in .env clientSecret: process.env.SABRE_CLIENT_SECRET!, }), }); console.log('Client created. Service calls coming soon.');
Debug
Known issues
breakingAPI surface is unstable before 1.0. Breaking changes may occur in minor version bumps (0.x).
fix
Pin to exact version (e.g., 'sabre-rest@0.14.0') and review CHANGELOG before upgrading.
affects: <1.0.0
deprecatedNo deprecation warnings have been issued yet (package is <1.0).
fix
N/A
gotchaRequires Node.js 22 or later due to process.loadEnvFile usage. Older Node versions will throw.
fix
Upgrade to Node.js 22+ or use a polyfill for process.loadEnvFile.
affects: >=0.0.0
gotchaThe CLI is provisional; flags and output shapes may change without notice in 0.x releases.
fix
For automation, use the programmatic API instead of the CLI.
affects: <1.0.0
gotchaSABRE_COMPANY_CODE defaults to 'TN'; if your Sabre account requires a different value, set it explicitly in environment or CLI args.
fix
Set SABRE_COMPANY_CODE environment variable to your company code.
affects: >=0.0.0
Errors
Common errors & fixes
ERR_MODULE_NOT_FOUND
Using CommonJS require() on an ESM-only package.
fix
Use 'import' or set 'type': 'module' in package.json.
TypeError: process.loadEnvFile is not a function
Running on Node.js version older than 22, which lacks process.loadEnvFile.
fix
Upgrade to Node.js 22+.
SabreOAuthError: Invalid client credentials
SABRE_CLIENT_ID or SABRE_CLIENT_SECRET environment variables are missing or incorrect.
fix
Ensure .env file or environment variables are set correctly.
Upgrade
Version history
0.14.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
41 hits · last 30 days
node
37
OpenAI (training)
1
Resources
sabre-rest — npm install sabre-rest · libregistry