Appearance
Delhivery authentication
Delhivery uses a static API token plus the registered client name.
OpenLogistics({ provider: "delhivery", token, clientName }) takes the same credentials and is the recommended entry point; the client below is the lower-level option.
Credentials
ts
import { DelhiveryClient } from "open-logistics";
const sdk = new DelhiveryClient({
token: process.env.DELHIVERY_TOKEN!,
clientName: process.env.DELHIVERY_CLIENT_NAME!,
});How auth works
- Every request sends
Authorization: Token <token>. - There is no login endpoint and no token refresh flow.
- The token is scoped to the Delhivery environment you were issued.
- The client name is injected into the Delhivery order and waybill calls.
Failure cases
- Missing
tokenthrowsError("Delhivery token is required") - Missing
clientNamethrowsError("Delhivery clientName is required") - API failures throw
DelhiveryAPIError