githubEdit

API Reference

This section documents the SDK packages APIs.

Importing

Every function described in each package below is a top-level export. You can import any of them like this:

ES6

import { createClient } from '@commercetools/sdk-client'

ES5 (CommonJS)

var createClient = require('@commercetools/sdk-client').createClient

ES5 (UMD build)

// We recommend to use https://unpkg.com as CDN
var createClient = CommercetoolsSdkClient.createClient

Core

sdk-client

Core package to enable executing HTTP requestarrow-up-right. To be used together with middlewares.

Middlewares

It's up to you to pick whatever middleware fits your needs: you can compose them together, create your own custom versions, choose only one of them (e.g. you might not need authentication, but you need to send http requests).

sdk-middleware-auth

Middleware to authenticate the requestarrow-up-right using one of the supported auth flows.

sdk-middleware-http

Middleware to send the actual HTTP requestarrow-up-right.

sdk-middleware-queue

Middleware to throttle concurrent requestarrow-up-right to a certain limit. Useful to reduce concurrent HTTP requests.

sdk-middleware-logger

Middleware to log incoming requestarrow-up-right and responsearrow-up-right objects.

sdk-middleware-user-agent

Middleware to automatically set the User-Agent to the requestarrow-up-right.

sdk-middleware-correlation-id

Middleware to add a correlation id to requestsarrow-up-right.

Helpers

Those are optional packages that provides help building the final requestarrow-up-right. You can choose to use them but you don't have to.

api-request-builder

Provides an API to construct a URI for the HTTP API endpoints in a declarative way. Useful for building requestarrow-up-right uri for requests.

http-user-agent

Creates a proper HTTP User-Agent. Can be used everywhere.

sync-actions

Provides an API to construct update actions. Useful for building requestarrow-up-right body for updates.

Last updated