The commerce engine options.

interface CommerceEngineOptions {
    configuration: CommerceEngineConfiguration;
    loggerOptions?: LoggerOptions;
    middlewares?: Middleware<CommerceEngineState>[];
    navigatorContextProvider?: NavigatorContextProvider;
    preloadedState?: CommerceEngineState;
}

Hierarchy (View Summary)

Properties

The commerce engine configuration options.

loggerOptions?: LoggerOptions

The logger options.

middlewares?: Middleware<CommerceEngineState>[]

List of additional middlewares. A middleware is a higher-order function that composes a dispatch function to return a new dispatch function. It is useful for logging actions, performing side effects like routing, or turning an asynchronous API call into a series of synchronous actions.

type MiddlewareAPI = { dispatch: Dispatch, getState: () => State }
type Middleware = (api: MiddlewareAPI) => (next: Dispatch) => Dispatch

Redux documentation on middlewares.

navigatorContextProvider?: NavigatorContextProvider

An optional function returning navigation context. (referer, location, UserAgent)

preloadedState?: CommerceEngineState

The initial headless state. You may optionally specify it to hydrate the state from the server in universal apps, or to restore a previously serialized user session.