@warpfreight/sdk
Official TypeScript client for the Warp freight API.
Quote freight with zero credentials. No API key, no account, no card — install and get a real, bookable price on the first call.
npm install @warpfreight/sdk
import { WarpFreight } from "@warpfreight/sdk";
const warp = new WarpFreight();
const quote = await warp.quote({
origin_zip: "90001",
destination_zip: "10001",
pickup_date: "2026-09-01",
pallets: 2,
weight_lbs_per_pallet: 500,
commodity: "auto parts",
length_in: 48,
width_in: 40,
height_in: 48,
});
console.log(`$${quote.price_usd} · ${quote.transit_days} days · ${quote.quote_id}`);
That's it — a live rate from Warp's carrier network, all-inclusive, bookable.
Booking
Booking needs an API key (issued instantly at signup, no card required) and a card on file. Pass the key to the constructor or set WARPFREIGHT_API_KEY.
const warp = new WarpFreight({ apiKey: "wak_live_..." });
const booking = await warp.book({
quote_id: quote.quote_id,
patch: {
pickup: { refNum: "PO-1234" },
delivery: { refNum: "SO-5678" },
},
});
console.log(booking.shipment_number);
If no card is on file, book() rejects with a WarpFreightError whose code is WARPFREIGHT_PAYMENT_REQUIRED and whose checkoutUrl links to checkout — the quote stays valid.
import { WarpFreightError } from "@warpfreight/sdk";
try {
await warp.book({ quote_id });
} catch (err) {
if (err instanceof WarpFreightError && err.code === "WARPFREIGHT_PAYMENT_REQUIRED") {
console.log("Add a card:", err.checkoutUrl);
}
}
Tracking
const tracking = await warp.track(booking.shipment_number);
console.log(tracking.status);
Every mode, one call
quote() returns Warp's LTL rate. To compare all four modes (LTL, full truckload, cargo van, box truck) in one keyless call:
const all = await warp.compareModes({ origin_zip, destination_zip, pickup_date, pallets, weight_lbs_per_pallet });
Or compare 30+ LTL carriers for the lane with warp.marketOptions(...), or price a single mode with quoteVan / quoteBoxTruck / quoteFtl.
Configuration
| Constructor | new WarpFreight({ apiKey }) |
| Environment | WARPFREIGHT_API_KEY |
| Environment (deprecated alias) | WARP_API_KEY |
Override the base URL with new WarpFreight({ baseUrl }). On Node < 18, pass a fetch implementation.
Quotes are valid for 72 hours. Sandbox keys (wak_test_) return production-shaped responses without a real shipment or charge.
License
MIT