Releases: commercetools/merchant-center-application-kit
@commercetools-frontend/[email protected]
Patch Changes
-
#2200
9b9cf924
Thanks @renovate! - fix(deps): update dependency dotenv to v9 -
Updated dependencies [
0bfa1613
,99ea52d3
]:- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
0bfa1613
]:- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
f8b4acc1
]:- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
0bfa1613
,99ea52d3
]:- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
f8b4acc1
]:- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
0bfa1613
]:- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Patch Changes
- Updated dependencies [
f8b4acc1
]:- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
- @commercetools-frontend/[email protected]
@commercetools-frontend/[email protected]
Minor Changes
-
#2198
864ce386
Thanks @emmenko! - Add support for sending custom HTTP headers when using the/proxy/forward-to
endpoint.See the examples below on how to configure the HTTP headers for both scenarios.
All custom HTTP headers are sent to the Merchant Center API with a prefix
x-forward-header-
, as it allows the Merchant Center API to allow requests with those headers to be forwarded. However, the request forwarded to the external API contains the correct headers without the prefix.Usage for Apollo
The
createApolloContextForProxyForwardTo
function now supports passing custom HTTP headers.import React from 'react'; import { createApolloContextForProxyForwardTo, useMcQuery, } from '@commercetools-frontend/application-shell'; import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors'; const Fetcher = () => { // Assuming that the `custom-application-config.json` contains the custom value: // `{ additionalEnv: { externalApiUrl: 'https://my-custom-app.com/graphql'} }` const externalApiUrl = useApplicationContext( context => context.environment.externalApiUrl ); const { loading, data, error } = useMcQuery(MyQuery, { context: createApolloContextForProxyForwardTo({ // The URL to your external API uri: externalApiUrl, + headers: { + 'x-foo': 'bar' + } }), }); // ... };
Usage for SDK actions
All
forwardTo
proxy actions supports sending custom HTTP headers.actions.forwardTo.get({ uri: 'https://my-custom-app.com/graphql', + headers: { + 'x-foo': 'bar', + }, });
Patch Changes
- Updated dependencies [
864ce386
]:- @commercetools-frontend/[email protected]