# @scayle/storefront-nuxt (v7)

This changelog contains all changes prior to the release of `@scayle/storefront-nuxt@8.0.0`.

## 7.95.4

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.69.3

## 7.95.3

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.69.2

## 7.95.2

### Patch Changes

- Updated dependency `@vueuse/core@11.2.0` to `@vueuse/core@11.3.0`

## 7.95.1

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.69.1

## 7.95.0

### Minor Changes

- Move test factories to separate entry point. They are now available via `@scayle/storefront-nuxt/dist/test/factories` (or `@scayle/storefront-nuxt/test/factories` when `moduleResolution` is set to `Bundler`.

  The location of the test factories within the `@scayle/storefront-nuxt` entry point unintentionally caused them to be included in the client build. This resulted in an error because the client build attempted to import the default export of `lodash.mergeWith`, which is not available.

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.69.0

## 7.94.7

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.68.0

## 7.94.6

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.67.1

## 7.94.5

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.67.0

## 7.94.4

### Patch Changes

- Updated dependency `@scayle/storefront-core@7.66.5` to `@scayle/storefront-core@7.66.6`
  **Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.7

## 7.94.3

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.6

## 7.94.2

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.5

## 7.94.1

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.4

## 7.94.0

### Minor Changes

- Move `vitest` to dev dependencies

### Patch Changes

- Removed dependency `vitest@2.1.4`
- Add `useNavigationTreeById` and `useNavigationTreeByName` to the list of keyed composables

## 7.93.0

### Minor Changes

- Test factories are now exported via package source root (`./src/index.ts`).
  Now, all test factories can be imported as follows:

  ```ts
  import { categoryFactory } from '@scayle/storefront-nuxt'
  ```

- Add `product`, `variant`, `price`, `attribute` and `route` test factories.

### Patch Changes

- Added dependency `vitest@2.1.4`

## 7.92.0

### Minor Changes

- Add nitropack as a peer dependency

### Patch Changes

- Removed dependency `nitropack@^2.9.7`
  **Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.3

## 7.91.0

### Minor Changes

- Remove `category` utils

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.2

## 7.90.0

### Minor Changes

- Fix RPC context test factory `Log` import

## 7.89.0

### Minor Changes

- Add `category` test factory and expose all test factories. Moreover, `fishery` has
  been added to the `peerDependencies` as it is main dependency for the test factories.
  They can be used as follows:

  ```ts
  import { categoryFactory } from '@scayle/storefront-nuxt/test-factories'

  categoryFactory.build()
  ```

- Introduce `seo` and `category` utilities within the module and expose them as externals.
  The category utilities consist of various functions that manage category tree-structured data.
  The SEO utilities focus primarily on generating schemas and manipulating URLs for SEO purposes.

  They are exposed externally and can be used as follows:

  ```ts
  import { sanitizeCanonicalURL } from '@scayle/storefront-nuxt'

  sanitizeCanonicalURL('/en/women-2045')
  ```

### Patch Changes

- Added dependency `schema-dts@1.1.2`
- Updated dependency `ufo@^1.5.3` to `ufo@^1.5.4`
  **Dependencies**

- Updated dependency to @scayle/unstorage-compression-driver@0.1.5

## 7.88.1

### Patch Changes

- Updated dependency `@vueuse/core@11.1.0` to `@vueuse/core@11.2.0`
- Handle error when reading from or saving to the redirect cache

  With this change, when the application fails to read from the redirect cache it will log the error and fallback to using the SAPI endpoint.
  **Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.1

## 7.88.0

### Minor Changes

- Add `useNavigationTreeByName` and `useNavigationTreeById` composables.
  Deprecate `useNavigationTree` composable in favor of `useNavigationTreeById`.

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.66.0

## 7.87.2

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.11

## 7.87.1

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.10

## 7.87.0

### Minor Changes

- Added export entry for "./composables".

  Composables can now be directly imported using:

  `import { useCurrentShop } from '@scayle/storefront-nuxt/composables';`

## 7.86.0

### Minor Changes

- Add `formatPercentage` to `useFormatHelpers.ts`

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.9

## 7.85.16

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.8

## 7.85.15

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.7

## 7.85.14

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.6

## 7.85.13

### Patch Changes

- Updated dependency `@scayle/h3-session@^0.4.0` to `@scayle/h3-session@^0.4.1`
- Updated dependency `@scayle/unstorage-compression-driver@^0.1.3` to `@scayle/unstorage-compression-driver@^0.1.4`

## 7.85.12

### Patch Changes

- Support passing an internal access header
  **Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.5

## 7.85.11

### Patch Changes

- Update @nuxt/module-builder to 0.8.4

## 7.85.10

### Patch Changes

- Update @nuxt/module-builder to 0.7.1

## 7.85.9

### Patch Changes

- Update @nuxt/module-builder to 0.6.0

## 7.85.8

### Patch Changes

- Correct the types of `useOrder` and `useOrderConfirmation`
  **Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.4

## 7.85.7

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.3

## 7.85.6

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.2

## 7.85.5

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.1

## 7.85.4

### Patch Changes

**Dependencies**

- Updated dependency to @scayle/storefront-core@7.65.0

## 7.85.3

### Patch Changes

- Replaced `radash` utils with custom native implementations
- Replace `yn` with custom `stringToBoolean` utility function.
  NOTE: As the parsing of boolean environment values has been changed,
  this might have unwanted effects if the respective values have been incorrectly
  defined within the environment.
  **Dependencies**

- Updated dependency to @scayle/storefront-core@7.64.4

## 7.85.2

### Patch Changes

- Fixed bootstrap middleware logging `[object Object]` by providing an appropriate log message and passing the object as optional data parameter

## 7.85.1

### Patch Changes

- Fix `@vueuse/core` version to `11.0.3`

## 7.85.0

### Minor Changes

- Fix typing when using `transform`, `default` or `pick` in RPC composables

NOTE: This update corrects some broken typings and as a result may require some code changes.
Previously many composables asserted that the default value would match the response value even when relying on the fallback `default` factory function: `() => null`.
Due to this, the `data` property would be typed as `Ref<T>` even when it would be `Ref<null>` in case of error on a still pending request.
The types have now been corrected to respect the `default` factory function's return and accurately represent the behavior.
This means that you may have to add additional null checks in your code for typechecking to pass.

For example:

**In 7.84.6**

```ts
useBrand({
  params: { brandId: 1 },
}).data satisfies Ref<Brand>

useBrand({
  params: { brandId: 1 },
  options: {
    pick: ['id', 'isActive'],
  },
}).data satisfies Ref<Brand>

useBrand({
  params: { brandId: 1 },
  options: {
    transform: (brand) => brand.slug,
  },
}).data satisfies Ref<Brand>

useBrand({
  params: { brandId: 1 },
  options: {
    default: () => 'Brand not found',
  },
}).data satisfies Ref<Brand>
```

**In 7.85.0**

```ts
useBrand({
  params: { brandId: 1 },
}).data satisfies Ref<Brand | null>

useBrand({
  params: { brandId: 1 },
  options: {
    pick: ['id', 'isActive'],
  },
}).data satisfies Ref<Pick<Brand, 'id' | 'isActive'> | null>

useBrand({
  params: { brandId: 1 },
  options: {
    transform: (brand) => brand.slug,
  },
}).data satisfies Ref<string | null>

useBrand({
  params: { brandId: 1 },
  options: {
    default: () => 'Brand not found',
  },
}).data satisfies Ref<Brand | string>
```

For more details on `useAsyncData` usage check out the [Nuxt Docs](https://nuxt.com/docs/api/composables/use-async-data)

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.64.3

## 7.84.6

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.64.2

## 7.84.5

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.64.1

## 7.84.4

### Patch Changes

- Improve type definitions for exported composables

## 7.84.3

### Patch Changes

- - Updated dependencies
    - @scayle/storefront-core@7.64.0

## 7.84.2

### Patch Changes

- Add support for removing basket items using their item key
- Updated dependencies
  - @scayle/storefront-core@7.63.1

## 7.84.1

### Patch Changes

- Improve typing of `H3EventContext` and `Session.data`

## 7.84.0

### Minor Changes

- Migrate from `ModuleBaseOptions.stores` to `ModuleBaseOptions.shops`

## 7.83.0

### Minor Changes

- Introduce `disableDefaultGetCachedDataOverride` flag in the public runtime configuration. Setting this to true prevents `useRpc` from sharing data across multiple instances.
  Important: The `disableDefaultGetCachedDataOverride` flag currently does not affect the `useUser`, `useBasket`, and `useWishlist` composables. These composables will continue to share a common cache even when `disableDefaultGetCachedDataOverride` is set to true.
- Deprecate `useQueryFilterState` in the `@scayle/storefront-nuxt` package

### Patch Changes

- Remove `shopCampaignKeyword` from ShopConfigSchema
- Migrate from using `RpcContext.bapiClient` to using `RpcContext.sapiClient`
- Updated dependencies
  - @scayle/storefront-core@7.63.0

## 7.82.2

### Patch Changes

- Fix types of `useBasket` composable
- Fix types for more composables
- Migrate from using `RpcContext.bapiClient` to using `RpcContext.sapiClient`
- Updated dependencies
  - @scayle/storefront-core@7.62.0

## 7.82.1

### Patch Changes

- Fix types of `useBasket` composable
- Updated dependencies
  - @scayle/storefront-core@7.61.0

## 7.82.0

### Minor Changes

- Add new `useRpcCall` composable to make imperative RPC calls more ergonomic

  ```vue
  <script lang="ts" setup>
  const getConfig = useRpcCall('getShopConfiguration)
  const getProduct = useRpcCall('getProductById')
  const config = await getConfig()
  const product = await getProduct({ id: 1 })
  </script>
  ```

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.59.1

## 7.81.0

### Minor Changes

- Support enabling or disabling optional server-side plugins

  Plugins with optional behavior can now be disabled at build time through `env` variables.
  - `SFC_PLUGIN_CONFIG_VALIDATION_ENABLED` This plugin executes during app startup and validates the runtime config, exiting with an error if a problem is found. It is enabled by default and can be disabled by setting this variable to `false`.
  - `SFC_PLUGIN_POWERED_BY_ENABLED` This plugin sets the `X-Powered-By-Header` on every HTTP response to include SCAYLE. It is enabled by default and can be disabled by setting this variable to `false`.
  - `SFC_PLUGIN_RUNTIME_PERFORMANCE_ENABLED` This plugin improves performance by computing the runtime configuration at startup rather than for every request. It is enabled by default and can be disabled by setting this variable to `false`.

- Add a plugin to cache the runtime config

  This change adds a Nitro plugin to calculate the runtime config at startup, rather than for every requests. It offers significant performance improvements for large runtime configs.

### Patch Changes

- Add import for runtimeConfig plugin
- Revert type of `publicShopData` to `string[]`

## 7.80.0

### Minor Changes

- Do not set session cookie for cached pages

### Patch Changes

- Updated to `nuxt@3.12.2`
- Fix the the type off `publicShopData` in the config. This restores it to `(keyof ShopConfig)[]` instead of `string[]`, allowing its elements to be used to index a `ShopConfig`

## 7.79.1

### Patch Changes

- Import `useNitroApp` from `#imports`

## 7.79.0

### Minor Changes

- Add hooks before and after RPC execution (`storefront:rpc:before` and `storefront:rpc:after`) and when an RPC fails (`storefront:rpc:error`)

  These hooks allow you to execute extra logic before/after executing an RPC and even alter the properties of the RPC context/result.

  Hooks can be registered by adding a nitro plugin inside ´server/plugins/´:

  ```ts
  import { defineNitroPlugin } from '#imports'

  export default defineNitroPlugin((nitroApp) => {
    nitroApp.hooks.hook('storefront:rpc:before', (rpcName, rpcContext) => {
      rpcContext.log.debug(`Before: ${rpcName}`)
    })

    nitroApp.hooks.hook(
      'storefront:rpc:after',
      (rpcName, rpcContext, result) => {
        rpcContext.log.debug(`After: ${rpcName} returned ${result}`)
      },
    )

    nitroApp.hooks.hook(
      'storefront:rpc:error',
      (rpcName, rpcContext, error) => {
        rpcContext.log.error(`ERROR: ${rpcName} did throw ${error}`)
      },
    )
  })
  ```

  Added [`callHook`](https://github.com/unjs/hookable?tab=readme-ov-file#async-callhook-name-args), `callHookParallel` and [`callHookWith`](https://github.com/unjs/hookable?tab=readme-ov-file#callhookwith-name-callerfn) to `RpcContext` to allow triggering hooks within RPCs

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.59.0

## 7.78.1

### Patch Changes

- Import `useNitroApp` from `#imports`

## 7.78.0

### Minor Changes

- Support shops with multiple paths

  The `path` property in the shop config can now be defined as an array of strings. If this is the case, multiple path prefixes will point to the same shop. For example, with the config `{ path: ['en', 'en-US'], shopId: 1001 }` both `example.com/en` and `example.com/en-US` will use shop 1001. Because it is the same shop, `/en` and `/en-US` will have the same locale and share user sessions, baskets and wishlists. The first path in the array will be considered the default path and used for API calls.

## 7.77.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.58.3

## 7.77.2

### Patch Changes

- Fix basket count calculation for baskets including item groups

## 7.77.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.58.2

## 7.77.0

### Minor Changes

- Add default `getCachedData` implementation to `useRpc`

  The default implementation looks like this:

  ```ts
  getCachedData(key, nuxtApp) {
    return nuxtApp._asyncData[key]?.data.value as TResult
  },
  ```

  compared to the default in `useAsyncData`

  ```ts
  getCachedData(key, nuxtApp) {
    const hydrationData = nuxtApp.isHydrating ? nuxtApp.payload.data[key] : nuxtApp.static.data[key]
    return hydrationData ?? nuxtApp._asyncData[key]?.data.value as TResult
  }
  ```

  With this change multiple calls to the same composable with the same key will reference the cache. Previously, for every call of a composable a request would be sent except in hydration. This should be more similar to the pre-7.75.0 behavior.

  The `getCachedData` implementation can be overridden when calling `useRpc` or any related composable.

## 7.76.6

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.58.1

## 7.76.5

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.58.0

## 7.76.4

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.57.0

## 7.76.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.56.0

## 7.76.2

### Patch Changes

- Updated to `vue@3.4.27`
- Updated to `nuxt@3.11.2`

## 7.76.1

### Patch Changes

- `useRpc` will watch now `params` if it is a getter or ref, whereas previously it would only watch for refs

## 7.76.0

### Minor Changes

- `useOrder` `useOrderConfirmation` and `useIDP` are now optionally awaitable

## 7.75.1

### Patch Changes

- Add `immediate` option to `useUser` and deprecate `autoFetch`
- Log warning when deprecated `autoFetch` option is used

## 7.75.0

### Minor Changes

- Configure `keyedComposables` to automatically create keys for `useRpc` wrapping composables instead of relying on hardcoded defaults
- Export the `extendPromise` util
- Restore the `useAsyncData` implementation of `useRpc`

  Originally, `useRpc` was based on `useAsyncData` but in order to fix an issue with wishlists, we restricted the API and changed it to a rough emulation of `useAsyncData`. Because this emulation was similar, but not the same as `useAsyncData` it caused additional confusion. This change brings back the `useAsyncData` implementation.

  For developers, this means that `useRpc` will behave in the same manner as `useAsyncData`, be subject to the same restrictions and allow the same options.

  This also means that `useRpc` is now optionally awaitable. `const { data } = await useRpc()` now works as well as `const { data } = useRpc()`. The difference is that the former will wait for the data to load, while the latter will initially be set to the default value.

  Composables which are simply wrappers around `useRpc` also inherit this new behavior. They accept the same options as `useAsyncData`, return the same properties (and possibly some additional ones) and are optionally awaitable.

  This includes the following composables:
  - `useBrand`
  - `useBrands`
  - `useCategories`
  - `useCategoryById`
  - `useCategoryByPath`
  - `useCurrentPromotions`
  - `useFilters`
  - `useNavigationTree`
  - `useNavigationTrees`
  - `useProduct`
  - `useProducts`
  - `useProductsByIds`
  - `useProductsByReferenceKeys`
  - `useProductsCount`
  - `usePromotions`
  - `usePromotionsByIds`
  - `useShopConfiguration`
  - `useUserAddresses`
  - `useVariant`

### Patch Changes

- It is no longer mandatory to `await` calls to `useFacet`, `useUser`, `useWishlist` and `useBasket`

## 7.74.0

### Minor Changes

- Support for `isDefault` to be an empty string.
  This resolves an issue where an `undefined` value of `isDefault` within a shop config is changed to an empty string during build-time and fails the config validation.

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.55.0

## 7.73.0

### Minor Changes

- Breaking: Renamed ModuleOptions to ModuleBaseOptions to differentiate it from other ModuleOptions used in different modules.

### Patch Changes

- Fix construction of API base path: When setting up a `baseURL` in combination with path based shop selection, the `baseURL` is now the first path segment of the API base path.
- Updated dependencies
  - @scayle/storefront-core@7.54.0

## 7.72.5

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.53.0

## 7.72.4

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.52.1

## 7.72.3

### Patch Changes

- Refactored composables to consistently use named exports rather than default exports and to use named functions instead of arrow functions

## 7.72.2

### Patch Changes

- Add import alias `#storefront/composables` to package.json imports and explicitly added import alias to build transpilation to prevent potential build issues

## 7.72.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.52.0

## 7.72.0

### Minor Changes

- Introduced a new feature that validates runtime configurations using Zod schemas upon server startup.
  The server will exit if validation fails.
- We now log a warning when an RPC method from `@scayle/storefront-nuxt` is overridden by an RPC custom implementation.

  If the override is intentional, we provide a new config option called `rpcMethodOverrides` to silence this warning.
  In the future, the warning will become an error message if the RPC is not explicitly marked as an override.

## 7.71.2

### Patch Changes

- Provide new import alias `#storefront/composables` to allow for explicit imports of composables provided by the `@scayle/storefront-nuxt` package instead of only relying on the Nuxt auto-import functionality

## 7.71.1

### Patch Changes

- Correctly set the `optimizeDeps` for the new `@scayle/storefront-api` package
- Updated dependencies
  - @scayle/storefront-core@7.51.1

## 7.71.0

### Minor Changes

- Add new shopSelector mode `path_or_default`

  The `path_or_default` mode is similar to `path`, but loading the root will open the default shop instead of redirecting to the first shop. So you can have a shop at `example.com/` and `example.com/de` instead of `example.com/en` and `example.com/de`. To set a default shop, add `isDefault: true` to the shop's configuration in the `nuxt.config`. When using `nuxt-i18n` the `strategy` option should be set to `prefix_except_default`. (This is the default value.)

## 7.70.0

### Minor Changes

- `rpcContext.campaignKey` will now be set to the key of the first active campaign matching `$shopConfig.storeCampaignKeyword`. When `$shopConfig.storeCampaignKeyword` is set, campaign keys not starting with `$shopConfig.storeCampaignKeyword` will be ignored.

  This behavior, is now similar to the nuxt 2 implementation.

- It is now also possible to extend the RPCContext using the `storefront:context:created` nitro runtime hook.

  ```ts
  import { defineNitroPlugin } from 'nitropack/runtime/plugin'
  // Augment RpxContext type
  declare module '@scayle/storefront-nuxt' {
    interface AdditionalRpcContext {
      myNewProp: string
    }
  }

  // Set new value on rpcContext
  export default defineNitroPlugin((nitroApp) => {
    nitroApp.hooks.hook('storefront:context:created', (rpcContext) => {
      rpcContext.myNewProp = 'My campaign key'
    })
  })
  ```

### Patch Changes

- Add campaignKey dependency to nitro
- Updated dependencies
  - @scayle/storefront-core@7.51.0

## 7.69.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.50.1

## 7.69.0

### Minor Changes

- Upgraded to `@scayle/storefront-api@v17.0.0` and replaced `@aboutyou/backbone`

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.50.0

## 7.68.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.49.4

## 7.68.0

### Minor Changes

- Use unique session cookie names for each shop

  To simplify the implementation and improve the stability of session handling, we now use a differently named cookie for each shop instead of depending on the `Path` attribute.

  This is a change only to the framework internals, and should not have any visible impact or require any code changes.

  Before: `Set-Cookie: $session=s:fa3746f9-88c8-4065-a6c9-0c7bee473dd8.pSoaN6Q7iFHHyWKE7s9gQAqdDzGb9fS8a478P7PHLxw; Path=/de`

  After: `Set-Cookie: $session-1001=s:fa3746f9-88c8-4065-a6c9-0c7bee473dd8.pSoaN6Q7iFHHyWKE7s9gQAqdDzGb9fS8a478P7PHLxw; Path=/`

  When a cookie is found that uses the old format, it will be migrated to the new.

### Patch Changes

- We stop bootstrapping requests where we can't determine a shop based on the request parameters.
  Previously, we fell back to the first shop configuration, which has now been removed.

  In this case, no `$rpcContext` is available during the request event.

  We also bootstrap the Nuxt Error Page with the correct shop config now.

- Updated dependencies
  - @scayle/h3-session@0.4.0

## 7.67.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.49.3

## 7.67.1

### Patch Changes

- `initialPath` option in `useFacet` should be optional
- Updated dependencies
  - @scayle/storefront-core@7.49.2

## 7.67.0

### Minor Changes

- Support passing initial path to `useFacet`

## 7.66.4

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.49.1

## 7.66.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.49.0

## 7.66.2

### Patch Changes

- We fixed a bug where we would attach a session to a request for `/favicon.ico` when no favicon was present in the public directory.

  This leads to a session conflict when using a path-based shop selector.

## 7.66.1

### Patch Changes

- Fix RpcContext containing outdated data for the remainder of the request after mutating the session data

## 7.66.0

### Minor Changes

- Fix variable used before initialization in `useBasket`

  Breaking: This change removes the `useEventListener` call from `useBasket`. This code was specific to the checkout page and it has been moved to that page in the Storefront Boilerplate (v1.0.0-rc.9). To make the necessary change in your own project, add the following code to `checkout.vue`.

  ```ts
  import type { CheckoutEvent } from '@scayle/storefront-nuxt'
  const { fetching, fetch } = await useBasket()

  const onCheckoutUpdate = async (
    event: MessageEvent<CheckoutEvent>,
    fetching: Boolean,
    fetchCallback: () => Promise<void>,
  ) => {
    if (fetching) {
      return
    } // prevent multiple fetches
    if (event?.data?.type === 'tracking') {
      const actionType = event.data.event?.event

      if (actionType === 'add_to_cart' || actionType === 'remove_from_cart') {
        await fetchCallback()
      }
    }
  }

  // Refresh basket if the user changes quantity or removes an item at checkout
  useEventListener('message', (event) =>
    onCheckoutUpdate(event, fetching.value, fetch),
  )
  ```

### Patch Changes

- Fixes an issue where the `refreshToken` was not exposed on the `RPCContext` even if the user is logged in.
- Updated dependencies
  - @scayle/storefront-core@7.48.2

## 7.65.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.48.1

## 7.65.0

### Minor Changes

- Add OpenTelemetry instrumentation to RPC methods

  This release adds the beginning of native instrumentation to the `@scayle/storefront-nuxt` package.

  If you are using the OpenTelemetry SDK in your application, a `Span` will now be created for calls to RPC methods. The `Span` will be named `storefront-nuxt.rpc/[method]` and have the following attributes:
  - `rpc.method` the method name
  - `rpc.server` `'storefront-nuxt.rpc'`
  - `rpc.payload` the payload passed to the RPC
  - `server.address` the hostname of the server
  - `server.port` the port of the server

  Additionally, the `Span`'s status will be set to `ERROR` or `OK` depending on the result of the RPC call.

  If you are not using the `@opentelemetry/sdk` in your application, this change will have no impact. A reference implementation of the OpenTelemetry SDK will be included in a future Storefront Boilerplate release.

## 7.64.1

### Patch Changes

- Format code with dprint
- Updated dependencies
  - @scayle/unstorage-compression-driver@0.1.3
  - @scayle/h3-session@0.3.6

## 7.64.0

### Minor Changes

- Add `useStorefrontSearch` composable

## 7.63.0

### Minor Changes

- Add support for dynamically adding query parameters to the IDP redirect callback URLs to be read back when the user returns from the IDP.

  ```ts
  const { data: externalIDPRedirects } = await useIDP({
    queryParams: { redirectTo: '/account' },
  })
  ```

  Please note that `code` and `state` are not supported as these are used by the SCAYLE Authentication API.

### Patch Changes

- Avoid querying for redirects on pages matching the `/__nuxt_error` pattern.
- Updated dependencies
  - @scayle/storefront-core@7.48.0

## 7.62.4

### Patch Changes

- Removed direct logging of `vm` in `log.client.ts` to fix a recursive/infinite logging issue, now logging `vm.$options` instead.
- Updated dependencies
  - @scayle/storefront-core@7.47.0

## 7.62.3

### Patch Changes

- Ensure composables are not called asynchronously in `useBasket` and `useFacet`

## 7.62.2

### Patch Changes

- Error pages should be bootstrapped based on the URL where the error occurred

  This resolves an issue where context properties such as `currentShop` and `availableShops` were not available on the error page.

## 7.62.1

### Patch Changes

- Revert breaking change in `handleIDPLoginCallback` signature
- Updated dependencies
  - @scayle/storefront-core@7.46.1

## 7.62.0

### Minor Changes

- Add `useProductsByReferenceKeys` composable
  Add `useCategoryById` composable

### Patch Changes

- Do not throw error in `useRpc`. This is the reversion of a change introduced in 7.61.5. If you need a thrown error when a `useRpc` request fails, check the `error` property returned by `useRpc` and `throw` it.
- Updated dependencies
  - @scayle/storefront-core@7.46.0

## 7.61.5

### Patch Changes

- Log errors that occur when attaching the session in bootstrap
- Update the type of `data` returned by `useRpc` to indicate that it may be undefined. Note: This may cause new typechecking errors. These cases should be corrected to handle `undefined`. It was always possible for `data` to be `undefined`, but the types did not represent that.
- Updated dependencies
  - @scayle/storefront-core@7.45.0

## 7.61.4

### Patch Changes

- Fix the type of uninitialized data in `useBasket` and `useWishlist`

  When the request for the basket/wishlist has not completed or has failed, the `data` property is `undefined`. In the previous release this was inadvertently changed to `null`. Now it is once again `undefined`.

## 7.61.3

### Patch Changes

- Fix types of useBasket and useWishlist

## 7.61.2

### Patch Changes

- Updated to `vue@3.4.21` (​For more details check the [Vue 3.4.21 Changelog](https://github.com/vuejs/core/blob/main/CHANGELOG.md#3421-2024-02-28​)
- Updated to `nuxt@3.10.3` (​For more details check the [Nuxt 3.10.3 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.10.3)​)
- Updated dependencies
  - @scayle/storefront-core@7.44.1

## 7.61.1

### Patch Changes

- `useBasket` and `useWishlist` should no longer trigger duplicate requests when used in multiple components. Note: As part of this change, the `options` parameter has been removed from both functions.

## 7.61.0

### Minor Changes

- Expose the `loginWithIDP` function from the `useSession` composable.
- Add error logging to RPC handler

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.44.0

## 7.60.1

### Patch Changes

- Prioritize the execution of `bootstrap` middleware so storefront server middlewares can depend on the extended `event.context`

  If your middleware depends on the `event.context` properties, it must be registered as a `serverHandler` and not automatically scanned from the `~/server/middleware` directory.

## 7.60.0

### Minor Changes

- ### Log Configuration changes

  Consolidate the logging configuration for `@scayle/storefront-nuxt`.

  Going forward, the logging needs to be configured on the public runtime that you can control through the `NUXT_PUBLIC_STOREFRONT_LOG_NAME` and `NUXT_PUBLIC_STOREFRONT_LOG_LEVEL` override parameters.

  We have also removed this setting from the module options and the private runtime to prevent misconfigurations.

  ### Authentication Config

  We removed the authentication config as it's not required for the Storefront Nuxt application.

## 7.59.0

### Minor Changes

- Breaking: Change default `sameSite` cookie attribute from `none` to `lax`
- Attach `headers` to the RPC context

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.43.0

## 7.58.3

### Patch Changes

- Update `/api/up` endpoint to also support non-GET requests

## 7.58.2

### Patch Changes

- Fix missing IP address on the RpcContext

## 7.58.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.42.1

## 7.58.0

### Minor Changes

- Add `useCategoryByPath` composable

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.42.0
  - @scayle/unstorage-compression-driver@0.1.2

## 7.57.4

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.41.3

## 7.57.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.41.2

## 7.57.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.41.1

## 7.57.1

### Patch Changes

- Update to `nuxt@3.10.2`

## 7.57.0

### Minor Changes

- Strip sensitive data from log messages

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.41.0

## 7.56.0

### Minor Changes

- Updated to `nuxt@3.10.1` and `vue@3.4.19` (_For more details check the [Nuxt 3.10.1 Release Notes](https://nuxt.com/blog/v3-10) and [Vue 3.4.19 Changelogs](https://github.com/vuejs/core/blob/main/CHANGELOG.md#3418-2024-02-09)_)

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.40.1

## 7.55.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.40.0

## 7.55.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.39.1

## 7.55.1

### Patch Changes

- Skip basic auth when `auth.username` or `auth.password` is nullish

## 7.55.0

### Minor Changes

- Export `unwrap()` from `@scayle/storefront-core`

## 7.54.0

### Minor Changes

- Authentication RPC methods include status codes in error cases

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.39.0

## 7.53.1

### Patch Changes

- Fix potential empty user after login
- Updated dependencies
  - @scayle/storefront-core@7.38.1

## 7.53.0

### Minor Changes

- Nest public `runtimeConfig` properties under the `storefront` key

  Breaking: `useRuntimeConfig().public.log` and `useRuntimeConfig().public.auth` should be replaced by `useRuntimeConfig().public.storefront.log` and `useRuntimeConfig().public.storefront.log`

## 7.52.0

### Minor Changes

- Allow the session of an `RpcContext` to be undefined

  BREAKING: This changes the structure of the `RpcContext`, so it may be a breaking change if you have written custom RPC methods.

  The affected properties on the `RpcContext` are `sessionId`, `wishlistKey` and `basketKey` and the affected methods are `destroySession`, `createUserBoundSession`, `updateUser`, and `updateTokens`. If you use these methods or properties in a custom RPC method, make sure that you handle the case where they might be undefined. TypeScript will also catch these cases if you have `strictNullChecks` enabled.

  You can check `context.sessionId` (or another session-dependent property) to determine if the session is present. If one of these properties is present, all will be. Alternatively, you can call `assertSession(context)` before referencing any properties on the context. If the session is not present, an error will be thrown. For any usage of `context` after `assertSession` is called, TypeScript will understand that the session properties are present.

- Do not attach session for cached request

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.38.0

## 7.51.2

### Patch Changes

- Updated to `nuxt@3.9.3` and `vue@3.4.15` (\__For more details check the [Nuxt 3.9.3 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.9.3) and [Vue 3.4.15 Changelogs](https://github.com/vuejs/core/blob/main/CHANGELOG.md#3415-2024-01-18)_)

  **NOTE: The minimum supported versions of the `@scayle/storefront-nuxt` package are `nuxt >=3.9.0` and `vue >=3.4.0`. Please update your application stack accordingly.**

- useRpc - clear error state when re-fetching

## 7.51.1

### Patch Changes

- Updated to `nuxt@3.9.2` and `vue@3.4.14` (_For more details check the [Nuxt 3.9.2 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.9.2) and [Vue 3.4.14 Changelogs](https://github.com/vuejs/core/blob/main/CHANGELOG.md#3414-2024-01-15_)

  **NOTE: The minimum supported versions of the `@scayle/storefront-nuxt` package are `nuxt >=3.9.0` and `vue >=3.4.0`. Please update your application stack accordingly.**

## 7.51.0

### Minor Changes

- Update dependency `jose` to the latest `5.2.0` version

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.37.0

## 7.50.1

### Patch Changes

- Update to `vue@3.4.10` (​For detailed changes see [Changelog for Vue](https://github.com/vuejs/core/blob/main/CHANGELOG.md)​)

## 7.50.0

### Minor Changes

- Update to `nuxt@3.9.1` and `vue@3.4.7` (_For detailed changes see [Blog post: Nuxt 3.9](https://nuxt.com/blog/v3-9) and [Blog post: Announcing Vue 3.4](https://blog.vuejs.org/posts/vue-3-4)_)

  **Please note that `@scayle/storefront-nuxt` is now compatible with `nuxt@9.0.0` or higher!**

### Patch Changes

- Updated dependencies
  - @scayle/h3-session@0.3.5

## 7.49.0

### Minor Changes

- Support `Response` returns in RPC methods

BREAKING: As part of this change, the return type of `ParamRpcHandler` and `NoParamRpcHandler` has been changed to also allow `Response`. This should have no impact on calling RPCs because the return will automatically be normalized. However, if you also importing the functions explicitly typed as `ParamRpcHandler` or `NoParamRpcHandler` and calling them directly, you may have to updated your code to handle the more expansive return type.

There is an `unwrap` function exported by this package (>=7.55.0) that can be used to normalize the type.

- Handle 401 from CO and delete session

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.36.0

## 7.48.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.35.0

## 7.48.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.34.1

## 7.48.0

### Minor Changes

- We added support for Identity Provider (IDP), enhancing our authentication and identity management capabilities.

### Patch Changes

- Fix runtime crash when using md5 for appKeys
- Updated dependencies
  - @scayle/storefront-core@7.34.0

## 7.47.0

### Minor Changes

- Create a shared logger instance per-server instead of per-request

## 7.46.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.33.0

## 7.46.0

### Minor Changes

- Use new password change API when oauth is enabled

### Patch Changes

- Locale is optional in formatCurrency
- Updated dependencies
  - @scayle/storefront-core@7.32.0

## 7.45.0

### Minor Changes

- Migrate currency formatters to a composable

  Because the currency formatter functions depend on the `useCurrentShop` composable, they must also be initialized through a composable. Additionally, because `formatPrice` was the same as `toCurrency` except that it excluded the symbol, the two functions have been merged into `formatCurrency`. If you don't want the currency symbol to be displayed, set the `style` option to `decimal`. These changes requires a small migration step.

  Before:

  ```typescript
  toCurrency(100, { currency: 'EUR' })
  formatPrice(100, { currencyFractionDigits: 2 })
  ```

  After:

  ```typescript
  const { formatCurrency } = useFormatHelpers()
  formatCurrency(100, { currency: 'EUR' })
  formatCurrency(100, { style: 'decimal', currencyFractionDigits: 2 })
  ```

## 7.44.1

### Patch Changes

- The api/up route should not be bootstrapped with the context

## 7.44.0

### Minor Changes

- Update SAPI SDK to v16

### Patch Changes

- Fix error when mounting vercelKV driver with default options
- Updated dependencies
  - @scayle/storefront-core@7.31.0

## 7.43.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.30.0

## 7.43.0

### Minor Changes

- Extend `StorageEntity` with optional `compression: 'none' | 'deflate' | 'gzip' | 'brotli'` option.
  Modify [unstorage](https://unstorage.unjs.io/) driver creation during server startup to configure`@scayle/unstorage-compression-driver` if value of `compression` is set to a supported compression algorithm.

### Patch Changes

- Ensure correct unstorage drivers are bundled
- Updated dependencies
  - @scayle/unstorage-compression-driver@0.1.1
  - @scayle/storefront-core@7.29.0

## 7.42.3

### Patch Changes

- Fix incorrect parsing of legacy config
- Include missing unstorage drivers in final build
- Updated dependencies
  - @scayle/storefront-core@7.28.2

## 7.42.2

### Patch Changes

- Ensure `useNuxtApp` is only called from a composable context in `useCategories`

## 7.42.1

### Patch Changes

- Ensure useNuxtApp is only called from a composable context

## 7.42.0

### Minor Changes

- Unify Storefront Core cache handling using the [Nitro Storage Layer - Mountpoints](https://www.nitropack.org/guide/storage#mountpoints)

  This release changes how cache and session storage is managed in Storefront Core. Storefront Core will now use the `storefront-cache` mountpoint as the root for its cache storage, and `storefront-session` for sessions storage. These can be manually configured through Nitro, but Storefront Core also now includes `storefront.storage.cache` and `storefront.storage.session` config options to automatically create these mountpoints.

  `storefront.storage.cache` is used to configure the primary global cache storage mounted under `storefront-cache`. If not configured, a dedicated memory driver is used.

  `storefront.storage.session` is used to configure the global session storage mounted under `storefront-session`. If not configured, a dedicated memory driver is used.

  The config options `storefront.redis`, `storefront.stores[X].redis`, `storefront.session.provider` and `storefront.cache.provider` have been deprecated in favor of the new `storage` config. In a future version, they will be replaced.

### Patch Changes

- Update to Nuxt `v3.8.2` (See [Nuxt v3.8.2 Release notes](https://github.com/nuxt/nuxt/releases/tag/v3.8.2) for details.)

## 7.41.0

### Minor Changes

- Add `campaignKey` to the RPC context

## 7.40.6

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.28.1

## 7.40.5

### Patch Changes

- Allow setting the log level in the module config
- Prevent infinite loops when log writing fails
- Updated dependencies
  - @scayle/storefront-core@7.28.0

## 7.40.4

### Patch Changes

- Resolve error with newly introduced `nitro` plugin during local dev mode

## 7.40.3

### Patch Changes

- Introduce `nitro` server plugin to override `x-powered-by` header default value of `Nuxt` with `SCAYLE Storefront by SCAYLE Commerce Engine - www.scayle.com`

## 7.40.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.27.0

## 7.40.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.26.0

## 7.40.0

### Minor Changes

- Update to Nuxt `v3.8.1` (See [Nuxt 3.8 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.8.0) and [Nuxt 3.8.1 Release Notes](https://github.com/nuxt/nuxt/releases/tag/v3.8.1) for more details.)
- Refactored imports to be compatible with TypeScript `verbatimModuleSyntax` option (See [TypeScript 5.0 - verbatimModuleSyntax](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#--verbatimmodulesyntax) for more details.)
- Update to Vue `v3.3.8` (See [Vue 3.3.8 Release notes](https://github.com/vuejs/core/blob/main/CHANGELOG.md#338-2023-11-06) for more details.)

## 7.39.0

### Minor Changes

- Redirects should use the cache provider configured for the shop

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.25.1

## 7.38.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.25.0

## 7.38.0

### Minor Changes

- Ensure the session is not shared between different country shops

## 7.37.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.24.1

## 7.37.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.24.0

## 7.37.0

### Minor Changes

- Add `runtimeConfiguration` property to the `RPCContext`
- Breaking: Remove re-exported `useEventListener` composable

  Import the composable directly from @vueuse/core

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.23.0

## 7.36.3

### Patch Changes

- Add license file
- Updated dependencies
  - @scayle/storefront-core@7.22.1
  - @scayle/h3-session@0.3.4

## 7.36.2

### Patch Changes

- Fix SFC_OMIT_MD5 not being respected

## 7.36.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.22.0

## 7.36.0

### Minor Changes

- Breaking: Remove imageBaseUrl from the config. This property is no longer used in the Nuxt3 package.

## 7.35.0

### Minor Changes

- Updated to latest Vue version `v3.3.7`

## 7.34.0

### Minor Changes

- Updated to latest Vue version `v3.3.6`

## 7.33.0

### Minor Changes

- Add promotion data to the `addItemToBasket` method
- Add `usePromotions`, `useCurrentPromotions` & `usePromotionsByIds` composables

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.21.0

## 7.32.3

### Patch Changes

- Updated dependencies
  - @scayle/h3-session@0.3.3

## 7.32.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.20.0

## 7.32.1

### Patch Changes

- The `auth` config is optional
- Updated dependencies
  - @scayle/storefront-core@7.19.1

## 7.32.0

### Minor Changes

- Make the `shop` param required in `rpcCall`

## 7.31.0

### Minor Changes

- Support setting default `with` params in the module options

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.19.0

## 7.30.1

### Patch Changes

- Add timing to RPC log message

## 7.30.0

### Minor Changes

- Pass `withParams` through the private runtime storefront config

## 7.29.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.18.0

## 7.29.0

### Minor Changes

- Improve `useFacet` & `useQueryFilterState` computed types and `useRpc` error state type

### Patch Changes

- Fix build warning caused by `createError` import
- Updated dependencies
  - @scayle/storefront-core@7.17.0

## 7.28.0

### Minor Changes

- Handle errors and return proper status codes for RPC methods

## 7.27.0

### Minor Changes

- Add `cbdExpiration` to the checkout config to support expiring CBD tokens

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.16.0

## 7.26.0

### Minor Changes

- Breaking: Minimum node version is 20.7.0
- Import `computed` from `vue` instead of `#imports`
- Use default withParams config for `useProducts`, `useProduct`, `useProductsByIds`, `useVariant` and `usSearch`

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.15.1

## 7.25.3

### Patch Changes

- Avoid pulling in `redis` package as an accidental dependency
- Add sideEffects false
- Updated dependencies
  - @scayle/storefront-core@7.15.0

## 7.25.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.14.3

## 7.25.1

### Patch Changes

- Improve imports of useBasket

## 7.25.0

### Minor Changes

- Mark `autoFetch` as optional option for `useRpc`. The default is `true`.

## 7.24.0

### Minor Changes

- Always `await` autoFetched `useRpc` during SSR

## 7.23.0

### Minor Changes

- Add `lazy` option to `useRpc` options. This will allow fetching data without blocking client side navigation.

## 7.22.4

### Patch Changes

- Use unstorage for all redis caches
- Updated dependencies
  - @scayle/storefront-core@7.14.2

## 7.22.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.14.1

## 7.22.2

### Patch Changes

- Remove useCurrentShop from rpcCall
- Allow setting apiBasePath on shop config

## 7.22.1

### Patch Changes

- Fix redis connection in redirects module

## 7.22.0

### Minor Changes

- Change storefront composables signatures to be an options object

## 7.21.0

### Minor Changes

- Support apiBasePath option

## 7.20.2

### Patch Changes

- Add api/up handler

## 7.20.1

### Patch Changes

- Fix issue where errors within `useRpc` could not be serialized.

## 7.20.0

### Minor Changes

- `useRpc` and composables that are based on `useRpc` now expose `status` and `error`, to allow error handling.

### Patch Changes

- Updated dependencies
  - @scayle/h3-session@0.3.2

## 7.19.0

### Minor Changes

- Set OAuth settings when building the context to support runtime OAuth configuration
- Support enabling/disabling the cache using the runtime config

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.14.0

## 7.18.2

### Patch Changes

- `runtimeConfig.storefront.stores` now only accepts `ShopConfigIndexed` objects as value to simplify the usage.
  Passing a `ShopConfig[]` array into `runtimeConfig.storefront.stores` can lead to runtime errors.

## 7.18.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.13.0

## 7.18.0

### Minor Changes

- Provide option to pass `shopConfig` either as an array/list (`shopConfig[]`) or as an object (`shopConfigIndexed`) to make them overridable as part of the `runtimeConfig`.
  Internally they are still processed as array/list.

### Patch Changes

- Add sub dependencies `isomorphic-dompurify` and `slugify` to `optimizeDeps` list

## 7.17.0

### Minor Changes

- Add explicit vue/nuxt specific stuff imports
- Make `ToCurrencyOptions` of `toCurrency` and `FormatOptions` of `formatPrice` optional. They use the currentShop config as default.

## 7.16.0

### Minor Changes

- `runtimeConfig.$storefront` is now just `runtimeConfig.storefront`

## 7.15.1

### Patch Changes

- added missing slash for bapi.host default
- add missing auth section for PublicRuntimeConfig module declaration
- extend vite config as part of module setup and include storefront and axios (sapi) package for optimizeDeps include list
- set module nuxt compatibility to nuxt@3.7.0 or higher
- Updated dependencies
  - @scayle/h3-session@0.3.1

## 7.15.0

### Minor Changes

- Replace `lodash` with `radash`

## 7.14.0

### Minor Changes

- Add auth options within the module options

### Patch Changes

- Support server-side autoFetch for useUser, useWishlist and useBasket
- Updated dependencies
  - @scayle/storefront-core@7.12.2

## 7.13.0

### Minor Changes

- `withParams` are now exposed though `useRuntimeConfig().public` instead of `useRuntimeConfig().$storefront`

### Patch Changes

- Remove usages of `event.node.req`
- Updated dependencies
  - @scayle/h3-session@0.3.0

## 7.12.0

### Minor Changes

- Make composables share state across every instance.

### Patch Changes

- Updated dependencies
  - @scayle/h3-session@0.2.1

## 7.11.0

### Minor Changes

- Support top-level and shop-level definitions for bapi, appKeys, and redis configs

### Patch Changes

- Add isEnabled to ShopConfig options
- Update `rpcCall` to accept a `NuxtApp` instance as its first parameter

## 7.10.0

### Minor Changes

- Add useUserAddresses composable
- Add useNavigationTree and useNavigationTrees composables
- Add useOrder and useOrderConfirmation composables

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.12.1

## 7.9.0

### Minor Changes

- Wrap `refreshProductCount` in `useFacet` composable so that have proper where condition typing

### Patch Changes

- Prevent nuxt from setting wrong default value to `session.maxAge` in module options
- Add `refreshProductCount` filter params default

## 7.8.1

### Patch Changes

- Make selection of fetch function in `rpcCall` null safe
- Make `params` parameter within the `useBasket` and `useWishlist` optional
- Ensure that the accessing `withParams` is null safe within the `useBasket`
  and `useWishlist` composables

## 7.8.0

### Minor Changes

- Add sessions module

### Patch Changes

- Updated dependencies
  - @scayle/h3-session@0.2.0

## 7.7.0

### Minor Changes

- Introduce `withParams` storefront option

## 7.6.1

### Patch Changes

- Share context between RPC requests
- Updated dependencies
  - @scayle/storefront-core@7.12.0

## 7.6.0

### Minor Changes

- Adjust `fetching` prop of useRpc to reflect more nuxt2 behavior
- Move `deserializeFilters` and `serializeFilters` to `@scayle/storefront-core`
- Extend existing composables return object with `status` and `error`
- Add `price` utils
- Add useFacet and useQueryFilterState composable

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.11.0

## 7.5.0

### Minor Changes

- Add `useBasket`, `useWishlist` and `useEventListener` composables

## 7.4.0

### Minor Changes

- Add redirects module

## 7.3.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.10.2

## 7.3.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.10.1

## 7.3.1

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.10.0

## 7.3.0

### Minor Changes

- Add cache module

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.9.0

## 7.2.0

### Minor Changes

- Support client- and server-side RPC calls
- Add useCurrentShop and useAvailableShops composables
- Add useSearch composable
- Add logging module and useLog composable
- Add useRpc composable
- Allow passing AsyncDataOptions to useRpc
- Add useShopConfiguration composable
- Add useFilters, useProduct, useProductsCount, useProductsByIds and useVariant composables
- Add useBrand and useBrands composables

### Patch Changes

- Add useProducts composable
- Add useCategories composable
- Updated dependencies
  - @scayle/storefront-core@7.8.0

## 7.1.5

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.7.1

## 7.1.4

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.7.0

## 7.1.3

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.6.1

## 7.1.2

### Patch Changes

- Updated dependencies
  - @scayle/storefront-core@7.6.0

## 7.1.1

### Patch Changes

- Add exports from storefront-core

## 7.1.0

### Minor Changes

- Add possibility to define the session config on application and store level.
- Add possibility to configure the `domain` attribute of the session cookie

## 7.0.0

### Major Changes

- **Changed NPM package names**
  - **Breaking**: Change package scope and name of `@aboutyou/scayle-sfc-nuxt` to `@scayle/storefront-nuxt2`
  - **Breaking**: Change package scope and name of `@aboutyou/sfc-nuxt3` to `@scayle/storefront-nuxt`
  - **Breaking**: Change package scope and name of `@aboutyou/scayle-sfc-lib` to `@scayle/storefront-core`
  - **Breaking**: Change package scope and name of `@aboutyou/eslint-config-sfc` to `@scayle/eslint-config-storefront`
  - **Breaking**: Change package scope and name of `@aboutyou/prettier-config-sfc` to `@scayle/prettier-config-storefront`

  _NOTE: Due to the changes of the NPM package scope from `@aboutyou` to `@scayle`,
  it is required to change the consuming projects local `.npmrc` file as follows:_
  - Before:

  ```text
  @aboutyou:registry=https://gitlab.com/api/v4/packages/npm/
  ```

  - After:

  ```text
  @aboutyou:registry=https://gitlab.com/api/v4/projects/29746107/packages/npm/
  @scayle:registry=https://gitlab.com/api/v4/projects/29746107/packages/npm/
  ```

- **Breaking**: Minimum `node` version raised to `18.15.0`

## 7.0.0-alpha.0

### Major Changes

- **Changed NPM package names**
  - **Breaking**: Change package scope and name of `@aboutyou/scayle-sfc-nuxt` to `@scayle/storefront-nuxt2`
  - **Breaking**: Change package scope and name of `@aboutyou/sfc-nuxt3` to `@scayle/storefront-nuxt`
  - **Breaking**: Change package scope and name of `@aboutyou/scayle-sfc-lib` to `@scayle/storefront-core``
  - **Breaking**: Change package scope and name of `@aboutyou/eslint-config-sfc` to `@scayle/eslint-config-storefront`
  - **Breaking**: Change package scope and name of `@aboutyou/prettier-config-sfc` to `@scayle/prettier-config-storefront`

  Due to the changes of the NPM package scope from `@aboutyou` to `@scayle`,
  it is required to change the consuming projects local `.npmrc` file as follows:
  - Before: `@aboutyou:registry=https://gitlab.com/api/v4/packages/npm/`
  - After: `@scayle:registry=https://gitlab.com/api/v4/packages/npm/`

- Minimum node version is 18.15.0
