Documentation
Everything you need to integrate the rateship SDK into your Node backend.
Everything you need to integrate the rateship SDK into your Node backend.
The SDK talks to EasyPost, Shippo, and ShipEngine directly from your backend using API keys you provide. No rateship account, no key storage. Below: where to get each key and any provider-specific gotchas.
EZ_... (test) or EZAK_... (production)shippo_test_... or shippo_live_...Authorization: ShippoToken <key>TEST_... (test) or live_... (production)API-Key: <key>Factory functions, one per provider, return adapters that plug into the RateShip constructor. Missing apiKey throws CONFIGURATION_ERROR immediately; construction does not hit the network, so invalid keys surface on the first getRates() call via errors[].
import { RateShip, easypost, shippo, shipengine } from "rateship";
// Configure any subset. At least one provider is required.
const client = new RateShip({
providers: [
easypost({ apiKey: process.env.EASYPOST_KEY! }),
shippo({ apiKey: process.env.SHIPPO_KEY! }),
shipengine({ apiKey: process.env.SHIPENGINE_KEY! }),
],
});If you only use one provider, import its factory via the subpath to keep the bundle smaller:
import { RateShip } from "rateship";
import { easypost } from "rateship/providers/easypost";
const client = new RateShip({ providers: [easypost({ apiKey: "..." })] });Subpath entries: rateship/providers/easypost, rateship/providers/shippo, rateship/providers/shipengine.
At v2.0 you can configure at most one adapter per provider type. Passing two easypost(...) adapters with different keys throws CONFIGURATION_ERROR at construction. Multi-tenant key rotation lands in a later release.
Next: Getting Rates.
The SDK talks to EasyPost, Shippo, and ShipEngine directly from your backend using API keys you provide. No rateship account, no key storage. Below: where to get each key and any provider-specific gotchas.
EZ_... (test) or EZAK_... (production)shippo_test_... or shippo_live_...Authorization: ShippoToken <key>TEST_... (test) or live_... (production)API-Key: <key>Factory functions, one per provider, return adapters that plug into the RateShip constructor. Missing apiKey throws CONFIGURATION_ERROR immediately; construction does not hit the network, so invalid keys surface on the first getRates() call via errors[].
import { RateShip, easypost, shippo, shipengine } from "rateship";
// Configure any subset. At least one provider is required.
const client = new RateShip({
providers: [
easypost({ apiKey: process.env.EASYPOST_KEY! }),
shippo({ apiKey: process.env.SHIPPO_KEY! }),
shipengine({ apiKey: process.env.SHIPENGINE_KEY! }),
],
});If you only use one provider, import its factory via the subpath to keep the bundle smaller:
import { RateShip } from "rateship";
import { easypost } from "rateship/providers/easypost";
const client = new RateShip({ providers: [easypost({ apiKey: "..." })] });Subpath entries: rateship/providers/easypost, rateship/providers/shippo, rateship/providers/shipengine.
At v2.0 you can configure at most one adapter per provider type. Passing two easypost(...) adapters with different keys throws CONFIGURATION_ERROR at construction. Multi-tenant key rotation lands in a later release.
Next: Getting Rates.