Skip to content

Releases: commercetools/merchant-center-application-kit

@commercetools-frontend/[email protected]

11 May 10:43
50a1ac0
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 10:43
50a1ac0
Compare
Choose a tag to compare

Patch Changes

  • #2199 0bfa1613 Thanks @renovate! - chore(deps): update all dependencies

  • #2203 99ea52d3 Thanks @tdeekens! - Fixes babel-preset-mc-app warnings about loose mode. You can now pass a disableLooseMode option to this preset to turn it off (defaults to true).

@commercetools-frontend/[email protected]

11 May 21:52
7c0e13d
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 13:47
8ce9d3f
Compare
Choose a tag to compare

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

@commercetools-frontend/[email protected]

11 May 10:43
50a1ac0
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 21:52
7c0e13d
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 10:43
50a1ac0
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 10:43
50a1ac0
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 21:52
7c0e13d
Compare
Choose a tag to compare

Patch Changes

@commercetools-frontend/[email protected]

11 May 10:43
50a1ac0
Compare
Choose a tag to compare

Patch Changes