interface CommercetoolsHooks {
    onAfterResponse?: ((response) => void);
    onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>);
}

Hierarchy (view full)

Properties

onAfterResponse?: ((response) => void)

If passed in, will be called once a request has been made and the response received (or error thrown).

Type declaration

onBeforeRequest?: ((requestConfig) => CommercetoolsRequest | Promise<CommercetoolsRequest>)

If passed in, will be called before sending a request to commercetools. The {@see requestConfig} parameter can be manipulated if you wish to modify/add headers or any other request data.

Type declaration