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 request. 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

Middelware to authenticate the request using one of the supported auth flows.

sdk-middleware-http

Middelware to send the actual HTTP request.

sdk-middleware-queue

Middelware to throttle concurrent request to a certain limit. Useful to reduce concurrent HTTP requests.

sdk-middleware-logger

Middelware to log incoming request and response objects.

sdk-middleware-user-agent

Middelware to automatically set the User-Agent to the request.

Helpers

Those are optional packages that provides help building the final request. 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 request 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 request body for updates.

results matching ""

    No results matching ""