---
title: Release Notes
slug: oms/gatsby-theme-autonomy-release-notes
docTags: 
createdAt: 2022-11-07T21:29:48.000Z
---

## v6.1.0

This release bumps the version of `react-autonomy` dependency from `v2.0.4` to` v2.13.0`

## v6.0.4

This release exports a list of promotion utility functions:

- `eligibleOrderPromotion `- checks if an adjustment is an eligible order-level promotion
- `eligibleLineItemPromotion` - checks if an adjustment is an eligible line-item-level promotion
- `getOrderPromotions` - returns all eligible order promotions
- `getLineItemPromotions` - returns all eligible line item promotions
- getAllCartPromotions - combines order and line item promotions
- `getAllCartPromotionsForDisplay` - formats promotions for UI display with grouped amounts and labels

## v6.0.3

This release adds two properties to the "Order Completed" Segment event: `has_subscription` and `is_recurring`. These properties already exist on the "Order Completed" event Segment event sent by the Chord OMS.

- `has_subscription` is a boolean that indicates whether the order contains a subscription.
- `is_recurring` is a boolean that indicates whether the order is a subscription installment order and will always be false, since subscription installment orders are not placed via the SDK.

## v6.0.2

This release adds a `url` property to the [`Product`](https://docs.chord.co/chord-ui/interface-product) type that is an optional or required argument you can pass to the following methods:

- `useAnalytics().trackCartViewed()`
- `useAnalytics().trackProductClicked()`
- `useAnalytics().trackProductViewed()`
- `useAnalytics().trackVariantClicked()`
- `useCart().addToCart()`
- `useCart().removeFromCart()`
- `useCheckout().finalizeCheckout()`
- `useCheckout().prepareCheckout()`
- `useProduct().createStockRequest()`
- `useSubscription().cancelSubscription()`
- `useSubscription().pauseSubscription()`
- `useSubscription().resumeSubscription()`
- `useSubscription().skipSubscription()`

When the `url` property is given a value, the value will be sent as the `url` property in the resulting Segment event.

## v6.0.1

This release restores the ability to send an `ACS-Store` header with all requests to the OMS. This is necessary for users operating storefronts with multiple stores. In order to use this, you must supply the `storeSlug` option in your `gatsby-config.js` like so:

```javascript
module.exports = {
  plugins: {
    {
      resolve: '@chordcommerce/gatsby-theme-autonomy',
      options: {
        omsConfig: {
          brandName: process.env.GATSBY_CHORD_OMS_BRAND_NAME,
          storeId: process.env.GATSBY_CHORD_OMS_STORE_ID,
          omsId: process.env.GATSBY_CHORD_OMS_ID,
          tenantId: process.env.GATSBY_CHORD_OMS_TENANT_ID,
          domain: process.env.GATSBY_CHORD_OMS_API_URL,
          // add this option if you need multi-store support
          storeSlug: process.env.GATSBY_CHORD_OMS_STORE_SLUG,
        },
        // omitted the rest of the config for this plugin for brevity
      },
    },
  },
}
```

You can find the store's slug in your OMS (see figure below). Omitting this value will default all storefront operations to the default store.

::Image[]{src="https://api.archbee.com/api/optimize/TmutqdeXiIw-V3gBZXVjd/iLj-xLUgbF_eO6keVACh5_screenshot-2023-06-22-at-114448.png" size="64" width="552" height="419" caption="How to find your store's slug" position="center" showCaption="true"}

## v6.0.0

This release adds an “Order Completed” Segment event to the `finalizeCheckout()` method. Previously, `finalizeCheckout()` sent a “Checkout Completed” Segment event. Now, `finalizeCheckout()` sends both “Order Completed” and “Checkout Completed”.

No changes to your website code are required to upgrade to this release. However, we’re releasing this change as a new major version because the “Order Completed” event is a standard event that many Segment destinations process automatically, and adding it may impact the way your Segment destinations track conversions and revenue.

“Order Completed” is part of the Segment [ecommerce event spec](https://segment.com/docs/connections/spec/ecommerce/v2/). It is usually mapped by default to standard conversion/purchase events in Segment destinations like the [Facebook Pixel](https://segment.com/docs/connections/destinations/catalog/facebook-pixel/) and [TikTok Conversions](https://segment.com/docs/connections/destinations/catalog/tiktok-conversions/) destinations. You can override this mapping in the Segment destination settings. You may have changed the event mapping in your Segment destination settings to map “Checkout Completed” to the conversion/purchase event for the destination. This will continue to work.

The Chord OMS back-end Segment source has always sent an “Order Completed” event, and you may have connected Segment destinations to this source that are using this event to track conversions and revenue. We recommend continuing to rely on this “Order Completed” event, if possible, because events from back-end sources tend to be more reliable and accurate. (You can read more about this [from Segment](https://segment.com/academy/collecting-data/when-to-track-on-the-client-vs-server/).)

If you currently have any Segment destinations connected to both the Chord OMS back-end Segment source (typically named "My Company Back-End (Production)”) and your website front-end Segment source (typically named "My Company Front-End (Production)”), you may want to add a [destination filter](https://segment.com/docs/guides/filtering-data/#destination-filters) to stop your destination from receiving “Order Completed” events from one of the two Chord Segment sources. If a destination receives an “Order Completed” event from both sources, that could result in revenue or conversions being double counted.

**Note regarding the&#x20;**[Google Universal Analytics Segment destination](https://segment.com/docs/connections/destinations/catalog/google-analytics/#google-universal-analytics-destination)**:&#x20;**&#x54;his destination accepts `total` *or* `revenue` as a property on "Order Completed", but not both. The "Order Completed" event does include both of these properties, to match the Segment ecommerce spec and to be compatible with other Segment destinations. You may need to add a destination-specific [transformation](https://segment.com/docs/protocols/transform/) to remove one of the two properties.

## v5.0.2

This release reverts a change made in `v5.0.1` to the `trackPage` option of the `segmentConfig` configuration object. Prior to `v5.0.1`, page tracking was not optional and the `trackPage` option was ignored. In `v5.0.1`, passing `trackPage: true` would result in double pageviews. `v5.0.2` reverts this change.

## v5.0.1

This release fixes a bug where the `manualLoad` option in the `segmentConfig` configuration object was being ignored and always set to `false`. This meant that Segment tracking did not work if the site was not using Segment's Consent Manager or explicitly calling `analytics.load("YOUR_WRITE_KEY")`. If you are using the site without Segment's Consent Manager, you should initialize the site with the following keys in your `gatsby-config.js`:

```javascript
module.exports = {
  {
    resolve: '@chordcommerce/gatsby-theme-autonomy',
    options: {
      segmentConfig: {
        // Rest of the Segment config here
        manualLoad: false,
      },
    },
  },
}
```

## v5.0.0

This release refactors the Stytch integration works with this library. This is breaking change compared to v4.0.0 and requires you to redo how you initialize Stytch in this library, if you are using it. You can look at the document below to see how to use this library.

[Gatsby ↔️ Stytch Migration Guide](docId\:phG0ANbLWVGitsjinrWZG)

## v4.1.2

This release updates the `@chordcommerce/chord-magic` dependency to `v1.4.0`  and the `@chordcommerce/react-autonomy` dependency to `v1.2.0`.

## v4.1.1

This bugfix release addresses some bugs caused by our Stytch integration in non-Stytch setups introduced in v4.1.1.

## v4.1.0

This release brings support for [Stytch](https://stytch.com/) as an approved Chord authentication provider. Documentation on how to setup and use Stytch can be found [here](#).

## v4.0.0

This release is a significant refactor that updates `@chordcommerce/gatsby-theme-autonomy` to use Chord's [React](docId\:EwXkRz0JhH0zPphIkkcrI) SDK for most functionality. Please see the [v3.x to v4.x Migration Guide](docId\:mNQv6_UgqFWTNXfAkC-e4) for instructions for upgrading.

Key highlights of this release include:

- Typescript support
- Removed dependency on CMS product catalog
- JSDoc documentation
- Improved hooks and methods

This release contains significant breaking changes, mostly around method names and arguments. We recommend reading the [v3.x to v4.x Migration Guide](docId\:mNQv6_UgqFWTNXfAkC-e4) before upgrading.

## v3.0.0

This major release of this Gatsby theme moves Gatsby and all related Gatsby plugins and transformers from direct `dependencies` to `peerDependencies` so that consumers of this package can upgrade Gatsby without any intervention from Chord. This will require you to do more than just bump this version in the `package.json`.

First, edit your `package.json` to drop `@chordcommerce/gatsby-theme-autonomy` and any of the [listed peerDependencies in the theme's peerDependencies](https://github.com/chordcommerce/chord-ui/blob/main/packages/gatsby-theme-autonomy/package.json) from your `dependencies` block. We will be reinstalling them in the next section.

Then, you should run the following command in your shell:

```bash
# If you are using npm
$ npx install-peerdeps @chordcommerce/gatsby-theme-autonomy
# If you are using yarn
$ npx install-peerdeps --yarn @chordcommerce/gatsby-theme-autonomy
```

There is a chance that this command with fail with a very unhelpful error message. If that happens, the program will output an `npm install/yarn add` command that you can copy and run manually.

For more information and caveats around this, please read the [installation instructions for this package](https://github.com/chordcommerce/chord-ui/tree/main/packages/gatsby-theme-autonomy#installation).

## v2.2.2

This release fixes an issue where incorrect routes were being rendered to the sitemap. Routes should be rendered to the sitemap without the localization, for example: `https://example.com/products/t-shirt`, however only routes with the `en-US` localization were being rendered, for example: `https://example.com/en-US/products/t-shirt`. It is recommended that you upgrade to this version and then re-crawl your site via the Google Search Console.

## v2.1.0

This release adds `modifyLineItem` to the `useCart` hook providing more flexibility to modifying line items such as updating quantity and line item options. See [here](https://chord.stoplight.io/docs/chord-oms/b3A6MTE3Nzk1NjY-update-order-line-item#request-body) for accepted parameters.

## v2.0.6

This release updates `@chordcommerce/chord-magic` to `v1.1.1` is using the lates `magic-sdk` version 8.

## v2.0.4

Fix one issue with Square Checkout's `finalizeCheckout`: the SDK was calling `forgetOrder` before the actual call to finalize the checkout using the API. This was producing requests without any auth token, because the current order token was already lost when the request is sent. On Stripe there is another auth mechanism and it works with or without that token. To fix the issue, on Square \`forgetOrder is called only after a successful finalize.

## v2.0.3

Added `ACS-Anonymous-Id` header to all requests to track the Segment AnonymousId server side.  This is internal and will not impact customer development.

## v2.0.2

Change the existing `finalizeCheckout()` so that it is compatible with the Square checkout. In fact, this is the last step of the Square Checkout, which allows finalizing the order and allows the user to start a new one, and unlike Stripe, it can be called without a `checkout_session_id`. This method has been made available via the `useSquareCheckout` hook, even if it does exactly the same as the one provided in the `useCart` hook.

## v2.0.1

Adds a new step of the Square checkout, that allows entering payment information, called `updateOrderPayment()`. To work, it should pass along a token retrieved on the client-side using the Square Web Payments APIs.

## v2.0.0

This release adds **support for** [Gatsby 4](https://www.gatsbyjs.com/gatsby-4/)**!** Please see the [v1.2.7 to v2.0.0 Migration Guide](docId\:YgaZbobbVet5LsMtKJkJG) for instructions for upgrading. There are no additional features, but be sure to check out release notes below if migrating from a version below `v1.2.7`.

Key highlights of this release:

- Support for [Gatsby 4](https://www.gatsbyjs.com/gatsby-4/) and all the performance benefits. See [Gatsby 3](https://www.gatsbyjs.com/docs/reference/release-notes/v3.0/) and [Gatsby 4](https://www.gatsbyjs.com/docs/reference/release-notes/v4.0/) release notes for further reading
- Support for new [gatsby-plugin-image](https://www.gatsbyjs.com/docs/reference/built-in-components/gatsby-plugin-image/)
- Now using React 17! See [React 17 release notes](https://reactjs.org/blog/2020/10/20/react-v17.html)
- Recommended Node version 16.13.1

### Troubleshooting

See [troubleshooting](#) in the [v1.2.7 to v2.0.0 Migration Guide](docId\:YgaZbobbVet5LsMtKJkJG) for all troubleshooting related to upgrading.

### Upgrading from a version below `v1.2.7`

Please read the release notes for previous releases to find out what changed, but important breaking changes to highlight include:

**Segment Consent Manager (breaking change in )**

See the change to the Segment Consent Manager in v1.2.0 release notes and ensure you have the `segmentConfig` set in `gatsby-config.js`.

**Product Merchant feed (breaking change in )**

This theme no longer provides a Merchant feed. See the change in v1.0.6 release notes and implement a feed in your website code.

### Other Breaking Changes

### AuthError and AuthErrorCodes no longer exported from @chordcommerce/gatsby-theme-autonomy

AuthError and AuthErrorCodes are no longer exported from `@chordcommerce/gatsby-theme-autonomy`. This is because they were directly related to the `@chordcommerce/chord-magic` package. If you are importing these, you will now have to update to import from `@chordcommerce/chord-magic`.

**Before**

```javascript
import { AuthError, AuthErrorCodes } from '@chordcommerce/gatsby-theme-autonomy'
```

**After**

```javascript
import { AuthError, AuthErrorCodes } from '@chordcommerce/chord-magic'
```

## v1.2.7

Fixes a bug where an expired user session continues to be retried instead of being cleared from the app state.

## v1.2.6

Adds a new step of the Square checkout, this time to update the order's delivery options, with `updateOrderDelivery()` For now, it just works when a single delivery option is available, and it is only used to move the order to the payment state.&#x20;

## v1.2.5

This version fixes a bug where, when an order is completed, the completed order is still momentarily still available from the `useCart` hook. Now the order is cleared as soon as `finalizeCheckout()` is called. No changes to React components are required for this fix.

This version also includes a new `forgetCart()` method that can be used in similar situations if necessary.&#x20;

## v1.2.4

This version includes the first functions to start a checkout with Square. It is still experimental and we will release a new major version when the whole checkout flow will be available. This version only adds:

- `updateOrderAddresses()` to update an existing order with a shipping address.
- `getStates()` to retrieve the list of states in a specific country. Their ids will be used in the body of the request when updating an order's address.

## v1.2.0

Key highlights of this release:

This release adds support to manually load our [Segment plugin](https://github.com/benjaminhoffman/gatsby-plugin-segment-js), in order to implement Segment's [Consent Manager](https://github.com/segmentio/consent-manager) in our starters. It introduces a change in the way you would normally configure Segment in your *theme*. Please see below.&#x20;

Starting from **v1.2.0**, it is now the responsibility of the *starter* to pass a proper Segment configuration to the *theme*, via the starter's `gatsby-config.js` file, as follow:

```javascript
 plugins: [
    {
      resolve: '@chordcommerce/gatsby-theme-autonomy',
      options: {
         ....

         segmentConfig: {
           prodKey: process.env.GATSBY_SEGMENT_PRODUCTION_WRITE_KEY,
           devKey: process.env.GATSBY_SEGMENT_DEV_WRITE_KEY,
           trackPage: true,
           host: 'https://cdn.segment.com',
           delayLoad: false,
           delayLoadTime: 1000,
           manualLoad: false
        }

        ...
      }
    }
  ]
```

Please read [this](https://github.com/benjaminhoffman/gatsby-plugin-segment-js#setup) to learn more details about those settings.

**Note:** `manualLoad` is an advanced feature. It is set to `true` by default in our Gatsby starters so that Segment's [Consent Manager](https://github.com/segmentio/consent-manager) can work properly. Alternatively, you can use it if you are calling `analytics.load({writeKey})` manually elsewhere in your code.

Use manualLoad `false` if you do not use, or have removed, the Consent Manager implementation (see below).

### Consent Manager & Gatsby Autonomy Starter

Gatsby starter **v2.3.0+ (Autonomy)** ships with a new [Consent Manager](https://github.com/segmentio/consent-manager) component. You can find it at: `/src/components/Segment/ConsentManager/index.jsx`.&#x20;

This component is an `analytics.js` add-on with support for consent management. At its core, the Consent Manager empowers visitors to control and customize their tracking preferences on the website. They can opt out entirely of being tracked, or selectively opt out of tools in which they don’t want their information stored.

The Consent Manager banner is shown automatically for visitors from the EU. You can also decide to show it by default by configuring the `GATSBY_SEGMENT_SHOULD_REQUIRE_CONSENT` new environment variable to `true` in your `.env` file.

We have also integrated a way to manage your Consent Manager preferences from the Starter's footer component.

**Integrations**

In order for the `Consent Manager` to work, you must setup Segment [integrations](https://segment.com/catalog/) in your target Segment workspace.

You can verify that your integrations (*Google Analytics*, *Amplitude*, etc) are accessible for the `Consent Manager` component by visiting the URL below. It **should not** return an empty array if you have properly configured them.&#x20;

```Text
https://cdn.segment.com/v1/projects/add-your-segment-api-key-here/integrations
```

### Troubleshooting

There is [a known Gatsby issue](https://github.com/gatsbyjs/gatsby/issues/23234) that might occurred, where a blank page is rendered all over the site.

This issue only occurs if you *build* and *serve* the site (as opposed to simply `yarn dev`). When/if that happens, edit your `/src/components/Segment/ConsentManager/index.jsx` and move the `{children}` coming from the *wrapRootElement* before the `<ConsentManager />`

Rebuild and serve (`yarn build && yarn serve`), or use your Netlify/Gatsby Cloud review apps and verify the results.

## v1.0.6

This release introduces a **breaking change**: the Product Merchant feed generator has been removed from this theme. It is now the responsibility of the *website code* to enable it. You can find an implementation example in the [following pull request](https://github.com/chordcommerce/chord-ui/pull/30).

