@vue-storefront/nuxt
12.0.0
Minor Changes
-
ADDED A Nitro server plugin that routes Nitro's raw server console output - including unhandled SSR errors - through the Alokai logger, so the multi-line text Nitro prints by default (which log collectors like GCP, Datadog, Elasticsearch cannot parse) is re-emitted as single structured GCP JSON entries matching the middleware log format. Installs a console→logger bridge that normalizes every server
console.error/warn(rendering Errors with their stack) and drops empty spacing lines. Registered automatically by the module; active only in production builds, so local dev output is unchanged. -
CHANGED The default logger option
includeStackTraceis nowtrue(wasfalse), aligning Nuxt with the middleware and Next.js defaults so 5xx/unexpected errors carry a stack trace out of the box. Setalokai.logger.includeStackTrace: falseinnuxt.configto opt out. Traces are still never attached to 4xx client errors.
Patch Changes
- Updated dependencies:
- @alokai/connect@2.4.0
11.0.2
Patch Changes
- Updated dependencies:
- @alokai/connect@2.3.2
11.0.1
Patch Changes
- Updated dependencies:
- @alokai/connect@2.3.1
11.0.0
Minor Changes
- ADDED Environment variable toggle to enable or disable the image optimizer at runtime. Set
NEXT_PUBLIC_IMAGE_OPTIMIZER_ENABLED=true(Next.js) orNUXT_PUBLIC_IMAGE_OPTIMIZER_ENABLED=true(Nuxt) to activate the optimizer; when unset or set to any other value, image URLs are passed through unchanged and the optimizer route returns 404. - ADDED Alokai Image Optimizer support for Nuxt, mirroring the Next.js
createImageOptimizer. Setalokai.imageOptimizer.hostsin your Nuxt config to register an@nuxt/imageprovider plus a/img-proxy/:host/**:pathserver route: image URLs that match a configured media host are rewritten to/img-proxy/{key}/...?width=&quality=&format=autoso the optimizer CDN can transform them, and the server route proxies the bytes back from the origin. Supports thedefaultandsapccURL variants and per-hostcacheControl.
The media host for each key is read from the public runtime config, which Nuxt overrides at runtime from NUXT_PUBLIC_{KEY}_MEDIA_HOST, so it stays overridable per deployment. Leaving it empty passes image URLs through untouched.
Usage
// nuxt.config.ts - @vue-storefront/nuxt must precede @nuxt/image in `modules`
export default defineNuxtConfig({
alokai: {
imageOptimizer: {
hosts: {
commerce: {}, // reads NUXT_PUBLIC_COMMERCE_MEDIA_HOST, `default` variant
},
},
},
});Patch Changes
- FIXED The image optimizer proxy route no longer follows upstream redirects (
fetchis called withredirect: "manual"), preventing SSRF via an open redirect on a configured media host (e.g. to internal cloud metadata endpoints). An upstream 3xx is now treated as a 502 upstream error instead of being forwarded without itsLocationheader. - Updated dependencies:
- @alokai/connect@2.3.0
10.0.0
Major Changes
- CHANGED BREAKING Upgraded to Nuxt 4. All Nuxt-related packages now require Nuxt
^4.0.0.
Migration Guide
1. Update Nuxt and related dependencies
Update your package.json:
-"nuxt": "^3.13.2",
+"nuxt": "^4.0.0",
-"nuxt-jsonld": "^2.0.8",
-"@nuxtjs/i18n": "^8.5.6",
+"@nuxtjs/i18n": "^10.2.3",
-"@pinia/nuxt": "^0.5.5",
+"@pinia/nuxt": "^0.11.0",
-"pinia": "^2.2.6",
+"pinia": "^3.0.4",2. Remove nuxt-jsonld module
nuxt-jsonld is not compatible with Nuxt 4. Replace useJsonld with native useHead:
modules: [
- 'nuxt-jsonld',...
]-import { useJsonld } from '#jsonld';
-useJsonld({ ... });
+useHead({
+ script: [
+ {
+ type: 'application/ld+json',
+ innerHTML: JSON.stringify({ ... }),
+ },
+ ],
+});3. Migrate i18n to v10 directory structure
i18n v10 enforces a new directory structure where all i18n files must be placed under a root-level i18n/ directory. Move locale files accordingly:
mkdir -p i18n
mv lang i18n/lang
mv i18n.config.ts i18n/i18n.config.tsUpdate imports in locale index files:
-import base from '@/lang/en/base.json';
+import base from '@/i18n/lang/en/base.json';4. Rename @alokai/instrumentation-nuxt3-module to @alokai/instrumentation-nuxt-module
-"@alokai/instrumentation-nuxt3-module": "...",
+"@alokai/instrumentation-nuxt-module": "...", modules: [
- '@alokai/instrumentation-nuxt3-module',...
+ '@alokai/instrumentation-nuxt-module',...
]5. Update @nuxt/image custom providers to v2 API
Custom image providers must use defineProvider from @nuxt/image/runtime:
-import { getImage as cloudinaryGetImage } from '#image/providers/cloudinary';
-import type { ProviderGetImage } from '@nuxt/image';
+import { defineProvider } from '@nuxt/image/runtime';
+import cloudinaryFactory from '@nuxt/image/runtime/providers/cloudinary';
-export const getImage: ProviderGetImage = (src, options, ctx) => {
+export default defineProvider({
+ getImage: (src, options, ctx) => {
// ...
- return cloudinaryGetImage(src, { ...options, baseURL }, ctx);
-};
+ const cloudinary = cloudinaryFactory();
+ return cloudinary.getImage(src, { ...options, baseURL }, ctx);
+ },
+});6. Replace useVModel with native computed
VueUse's useVModel returns a Ref type incompatible with Vue 3.5's v-model:
-import { useVModel } from '@vueuse/core';
-const internalModelValue = useVModel(props, 'modelValue', emit);
+const internalModelValue = computed({
+ get: () => props.modelValue,
+ set: (value) => emit('update:modelValue', value),
+});Patch Changes
- CHANGED Align dependency versions across SDKs, tooling, and shared configs.
- FIXED Standardize type usage to always reference API type packages across integrations and SDKs.
- Updated dependencies:
- @alokai/connect@2.0.0
- @alokai/instrumentation-nuxt-module@1.0.0
9.1.0
Minor Changes
Introduced Alokai instrumentation support
- CHANGED The
@vue-storefront/nuxtmodule now injects value ofNUXT_PUBLIC_ALOKAI_VERSIONenvironment variable into appConfig.
Patch Changes
- Updated dependencies:
- @alokai/instrumentation-nuxt3-module@1.0.0
9.0.0
Major Changes
- CHANGED Guarantee compatibility with
@alokai/connectpackage. - CHANGED Updated the package for compatibility with Node.js 22.
Key Updates:
- Upgraded to the latest version of Node.js 22
- Updated CI pipelines to use Node.js 22 for consistency.
- Updated
.nvmrcor.node-versionfiles to specify Node.js version22.14. - Upgraded
@types/nodeto version^22.13.17for compatibility with the latest Node.js features.
Recommendations:
- Use Node.js version
22.14.0or higher for optimal performance, security, and compatibility. - While Node.js 20 is technically supported, it is not recommended as it may cause compatibility issues with certain packages and has not been thoroughly tested.
CHANGED Replaced core dependencies with a new
@alokai/connectpackage.@vue-storefront/middleware,@vue-storefront/sdk,vue-storefront/logger,vue-storefront/unified-data-model,@vue-storefront/multistorewere replaced with@alokai/connect. The replacement preserves the same functionality and interface as the original packages. To read more about the@alokai/connectpackage, please refer to the documentation.
Minor Changes
- ADDED - every request now contains additional "x-alokai-locale" header.
- ADDED Module-based SDK configuration with
defineSdkModuleand enhanceddefineSdkConfigin@vue-storefront/nuxt. This new approach allows for better code organization and reusability of SDK modules.
Before (all modules inline in the config file)
apps/storefront-unified-nuxt/sdk.config.ts
export default defineSdkConfig(
({ buildModule, middlewareModule, config, getRequestHeaders }) => ({
unified: buildModule(middlewareModule<UnifiedEndpoints>, {
apiUrl: `${config.apiUrl}/commerce/unified`,
ssrApiUrl: `${config.ssrApiUrl}/commerce/unified`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
methodsRequestConfig:
config.defaultMethodsRequestConfig.unifiedCommerce.middlewareModule,
}),
}),
);After (modules extracted to separate files)
apps/storefront-unified-nuxt/sdk-modules/unified.ts
// Define reusable module
const unified = defineSdkModule(
({ buildModule, config, getRequestHeaders, middlewareModule }) =>
buildModule(middlewareModule<UnifiedEndpoints>, {
apiUrl: `${config.apiUrl}/commerce/unified`,
ssrApiUrl: `${config.ssrApiUrl}/commerce/unified`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
methodsRequestConfig:
config.defaultMethodsRequestConfig.unifiedCommerce.middlewareModule,
}),
);apps/storefront-unified-nuxt/sdk-modules/index.ts
export * from "./unified";apps/storefront-unified-nuxt/sdk.config.ts
import * as modules from "./modules";
const config = defineSdkConfig(modules);- ADDED Added Server Middleware handler appending
x-pathnameandx-searchparameters to Nuxt request object. - ADDED Added
defineGetConfigSwitcherHeaderfrom@alokai/connect/sdkas a global import source.
Patch Changes
- FIXED Added missing
h3imports fordefineEventHandlerandgetRequestURLinserverMiddleware.ts - Updated dependencies:
- @alokai/connect@1.0.0
9.0.0-rc.6
Patch Changes
- FIXED Added missing
h3imports fordefineEventHandlerandgetRequestURLinserverMiddleware.ts
9.0.0-rc.5
Minor Changes
- ADDED Module-based SDK configuration with
defineSdkModuleand enhanceddefineSdkConfigin@vue-storefront/nuxt. This new approach allows for better code organization and reusability of SDK modules.
Before
export default defineSdkConfig(
({ buildModule, middlewareModule, config, getRequestHeaders }) => ({
unified: buildModule(middlewareModule<UnifiedEndpoints>, {
apiUrl: `${config.apiUrl}/commerce/unified`,
ssrApiUrl: `${config.ssrApiUrl}/commerce/unified`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
methodsRequestConfig:
config.defaultMethodsRequestConfig.unifiedCommerce.middlewareModule,
}),
}),
);After
// Define reusable module
const unified = defineSdkModule(
({ buildModule, config, getRequestHeaders, middlewareModule }) =>
buildModule(middlewareModule<UnifiedEndpoints>, {
apiUrl: `${config.apiUrl}/commerce/unified`,
ssrApiUrl: `${config.ssrApiUrl}/commerce/unified`,
cdnCacheBustingId: config.cdnCacheBustingId,
defaultRequestConfig: {
getConfigSwitcherHeader,
headers: getRequestHeaders(),
},
methodsRequestConfig:
config.defaultMethodsRequestConfig.unifiedCommerce.middlewareModule,
}),
);
// Use module in config
export default defineSdkConfig({
unified,
});- ADDED Added Server Middleware handler appending
x-pathnameandx-searchparameters to Nuxt request object. - ADDED Added
defineGetConfigSwitcherHeaderfrom@alokai/connect/sdkas a global import source.
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.4
9.0.0-rc.4
Major Changes
- CHANGED Updated the package for compatibility with Node.js 22.
Key Updates:
- Upgraded to the latest version of Node.js 22
- Updated CI pipelines to use Node.js 22 for consistency.
- Updated
.nvmrcor.node-versionfiles to specify Node.js version22.14. - Upgraded
@types/nodeto version^22.13.17for compatibility with the latest Node.js features.
Recommendations:
- Use Node.js version
22.14.0or higher for optimal performance, security, and compatibility. - While Node.js 20 is technically supported, it is not recommended as it may cause compatibility issues with certain packages and has not been thoroughly tested.
Minor Changes
- ADDED - every request now contains additional "x-alokai-locale" header.
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.3
9.0.0-rc.3
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.2
9.0.0-rc.2
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.1
9.0.0-rc.1
Major Changes
Update packages to work with connect rc version
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.0
9.0.0-rc.0
Major Changes
Replace legacy packages with a connect package
8.1.0
Minor Changes
- CHANGED changed metatags content to fit new company name
8.0.0
Major Changes
- CHANGED The
configparameter available in the callback passed todefineSdkConfig()no longer contains computedmiddlewareUrlproperty. It now exposesapiUrlandssrApiUrlthat should be used instead.
Migration guide
- Update SDK configuration file
Update your SDK configuration file (apps/storefront-unified-nuxt/sdk.config.ts) so that registered modules use apiUrl and ssrApiUrl properties instead of middlewareUrl.
export default defineSdkConfig(({ buildModule, config, getRequestHeaders, middlewareModule }) => ({
commerce: buildModule(middlewareModule, {
- apiUrl: `${config.middlewareUrl}/commerce`,
+ apiUrl: `${config.apiUrl}/commerce`,
+ ssrApiUrl: `${config.ssrApiUrl}/commerce`,
}),
}));7.0.0
Major Changes
- CHANGED SDK configuration is initialized NOT immediately, but only when needed.
- CHANGED BREAKING from now on
getSdkis available instead ofsdkproperty on globalNuxtApp.$alokaiobject.
// get sdk instance
- const { sdk } = useNuxtApp().$alokai;
+ const sdk = useNuxtApp().$alokai.getSdk();
// fetch some data
sdk.unified.getProducts();6.2.0
Minor Changes
ADDED plugin providing the logger utility to the storefront via auto-import
6.1.0
Minor Changes
- CHANGED
defaultMethodsRequestConfig, so thegetCategory, andgetPagemethods will useGETrequest as a default.
6.0.2
Patch Changes
- CHANGED the package
@vue-storefront/sdkis now a peer dependency instead of dependency
6.0.1
Patch Changes
FIXED Removed backquote from defineSdkConfig.template
6.0.0
Major Changes
- BREAKING: Added functionality that automatically configures the proper URLs for SSR & SPA modes when mutlistore mode is enabled. Left your environment variables like in normal mode, just set
NUXT_PUBLIC_ALOKAI_MULTISTORE_ENABLEDtotrue.
5.0.0
Major Changes
- ADDED global state management with Pinia. This will allow you to keep your global state in a more organized way. It shares the data about:
- cart
- customer
- currency
- locale
This change will require you to refactor your composables to make use of the introduced state manager. As this is only a state management, you will still need to use the composables to fetch the data and put it into the state.
Every part of global state can now be used as refs so reading and writing to them is more straightforward.
Example of usage:
<template>
<div>
<p>Cart total: {{ cart.total }}</p>
<p>Customer name: {{ customer.firstName }} {{ customer.lastName }}</p>
<p>Currency: {{ currency }}</p>
<p>Locale: {{ locale }}</p>
</div>
</template>
<script setup>
const { cart, customer, currency, currencies, locale, locales } =
storeToRefs(useSfState());
// updating the currency state
currency.value = "USD";
// updating the cart state
onMounted(async () => {
cart.value = await useSdk().unified.getCart();
});
</script>- BREAKING CHANGED module configKey is changed from
vsftoalokai. Also, the support for thevsfkey in Runtime Envs has been changed toalokai.
meta: {
name: "@vue-storefront/nuxt",
- configKey: "vsf",
+ configKey: "alokai",
compatibility: {
nuxt: "^3.0.0",
},nuxt.options.runtimeConfig.public.alokai = defu(
- nuxt.options.runtimeConfig.public?.vsf as any,
+ nuxt.options.runtimeConfig.public?.alokai as any,
options
);Patch Changes
- Updated dependencies:
- @vue-storefront/sdk@3.2.0
4.1.1
Patch Changes
FIXED: Added getCurrencies unified endpoint to be fetch by HTTP GET. This change enable caching this endpoint on CDN.
4.1.0
Minor Changes
ADDED: Using the GIT_SHA environment variable as secondary input for cdnCacheBustingId option. You can still override this value through NUXT_PUBLIC_ALOKAI_MIDDLEWARE_CDN_CACHE_BUSTING_ID.
ADDED Value of Busting ID for CDN Cache. You can access it via config.cdnCacheBustingId.
CHANGED Deprecated middlewareUrl in defineSdkConfig context. Use config.middlewareUrl instead.
CHANGED Deprecated defaults in defineSdkConfig context. Use config.defaultMethodsRequestConfig instead.
CHANGED Depreacted vsf key in RuntimeConfig. Use alokai instead. You should change you environment variables. Example: Change from NUXT_PUBLIC_VSF_MIDDLEWARE_API_URL to NUXT_PUBLIC_ALOKAI_MIDDLEWARE_API_URL.
CHANGED Internal naming changed from VSF to Alokai. For e.g. we inject the SDK into the $alokai key in Nuxt App instead of $vsf as in previous versions.
4.0.1
Patch Changes
- CHANGED shared package wasn't being bundled with the release of the package
4.0.0
Major Changes
- CHANGED Updated core sdk dependency to latest version
- ADDED Added .config parameter in createSdk callback
Patch Changes
- Updated dependencies:
- @vue-storefront/sdk@3.1.0
3.1.1
Patch Changes
- FIXED Using the runtime config is now working properly. You can use
NUXT_PUBLIC_VSF_MIDDLEWARE_API_URL,NUXT_PUBLIC_VSF_MIDDLEWARE_SSR_API_URLandNUXT_PUBLIC_VSF_MULTISTORE_ENABLEDenvironments variables to define config in the runtime.
3.1.0
- ADDED
middlewareModuletodefineSdkConfigparams.
- import { UnifiedApiExtension } from "storefront-middleware/types"
+ import { UnifiedEndpoints } from "storefront-middleware/types"
export default defineSdkConfig(
- ({ buildModule, middlewareUrl, getRequestHeaders }) => ({
- commerce: buildModule(unifiedModule<UnifiedApiExtension>, {
- apiUrl: `${middlewareUrl}/commerce`,
- requestOptions: { headers: getRequestHeaders },
+ ({ buildModule, middlewareModule, middlewareUrl, getRequestHeaders }) => ({
+ commerce: buildModule(middlewareModule<UnifiedEndpoints>, {
+ apiUrl: `${middlewareUrl}/commerce`,
+ defaultRequestConfig: { headers: getRequestHeaders() },
}),
})
);- CHANGED deprecate
getCookieHeader, usegetRequestHeadersinstead
export default defineSdkConfig(
- ({ buildModule, middlewareModule, middlewareUrl, getCookieHeader }) => ({
+ ({ buildModule, middlewareModule, middlewareUrl, getRequestHeaders }) => ({
commerce: buildModule(middlewareModule<UnifiedEndpoints>, {
apiUrl: `${middlewareUrl}/commerce`,
- defaultRequestConfig: { headers: getCookieHeader() }, // Only cookie header is included.
+ defaultRequestConfig: { headers: getRequestHeaders() }, // All headers are included.
}),
})
);3.0.3
- CHANGED
@nuxt/kitlocked3.7.4version to@nuxt/kit@^3.7.4
3.0.2
- FIXED Multi-store URL calculation, now working correctly in the browser.
3.0.1
- CHANGED Set
@vue-storefront/sdkas a dependency instead of a peer dependency
3.0.0
- BREAKING Rewritten from scratch. Now the package exports a Nuxt module which allows to initialize the Vue Storefront SDK.