Skip to main content
The TypeScript SDK (@omni-commerce/sdk) is generated from the public OpenAPI spec, so every documented REST operation is a typed resource method. The command-line client uses the same spec — see Omni CLI. The unscoped npm name omnicommerce is reserved. The public org is @omni-commerce.

Install

Requires Node 18+ (global fetch). Named export only:

Authenticate

Use an organization API key (omni_sk_...) as a bearer token. Do not send organizationId on API-key requests.
Omit apiKey to read OMNI_API_KEY. Override the host with baseUrl or environment (https://omnicommerce.sg by default). See Authentication.

Resource clients

Each call takes one request object (path params, query, and JSON body together), then optional request options:
Per-request overrides:
await request.withRawResponse() returns { data, rawResponse } with status and headers.

Coverage

Looks, returns, settlements, marketplaces, search, evaluate, monitor, sync, Zalora, and the remaining documented tags follow the same pattern. The generator covers every REST operation in the API reference.

Errors

Non-2xx responses throw OmniError subclasses. See SDK errors. GET/HEAD/OPTIONS/PUT/DELETE retry on 5xx and network failures. 408 and 429 retry for every method. POST/PATCH are not retried on 5xx.

Webhooks

HMAC-SHA256 over {timestamp}.{rawBody} compared to X-Omni-Signature. See Webhooks.

Regenerate

From this repository: