@vue-storefront/next
9.0.0
Minor Changes
-
ADDED
@vue-storefront/next/instrumentationexport with a ready-to-useregisterhook. Wire it up from your app's rootinstrumentation.ts(export { register } from "@vue-storefront/next/instrumentation";) to re-emit Next.js' raw, multi-lineconsole.error/warndumps - which log collectors (GCP, Datadog, Elasticsearch) cannot parse - as single structured GCP JSON entries matching the middleware log format.registerinstalls a console→logger bridge that normalizes every serverconsole.error/warn(rendering Errors with their stack) and drops empty spacing lines. Active only in production Node runtime; local dev output is unchanged. -
ADDED The storefront logger now emits a one-time warning in a production Node server when
instrumentation.tsdid not wire the Alokairegisterhook, so a missing setup is surfaced instead of silently skipping SSR log normalization.
Patch Changes
- Updated dependencies:
- @alokai/connect@2.4.0
8.0.2
Patch Changes
- Updated dependencies:
- @alokai/connect@2.3.2
8.0.1
Patch Changes
- Updated dependencies:
- @alokai/connect@2.3.1
8.0.0
Minor Changes
-
ADDED
createImageOptimizerfactory, exported from@vue-storefront/next. It returns a Next.js custom imageloader(forimages.loaderFile) and aGETroute handler forapp/img-proxy/[host]/[...path]/route.ts, which together let an image CDN in front of the storefront (the Alokai Image Optimizer) optimize media-host images. Supports multiple media hosts (host key derives the env variable name, e.g.ct->NEXT_PUBLIC_CT_MEDIA_HOST), asapccvariant for the?context=query parameter, per-hostcacheControl, and per-hostloader/encodePath/buildUpstreamUrloverrides for hosts with their own image CDN or unsupported URL schemes. Compared to the hand-written store implementations it replaces, a missing SAP CCcontextparameter now passes the URL through instead of emitting anullsegment, and upstream network errors return a deterministic 502 instead of crashing the handler. -
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
createStorefrontEventsfactory, exported from@vue-storefront/next/client— a typed, client-side pub/sub for storefront domain events. The app declares its own event map and creates the boundemitStorefrontEvent/subscribeStorefrontEvent/useStorefrontEvent/StorefrontEventEmitterhelpers once; modules (analytics, personalization, search) emit and subscribe without the core knowing who listens.useStorefrontEventreads the handler through a ref so an inline handler doesn't re-subscribe every render;StorefrontEventEmitteremits once per mount (Strict-Mode-safe) for server-rendered pages. -
ADDED
getCurrentPathhelper, exported from@vue-storefront/next/server— returns the current request path (pathname + search) inside an App-Router Server Component, reading the headers set bycreateAlokaiMiddlewareso the underlying header names stay an implementation detail. It lives in a dedicatedserverentry (not the main one) because it importsnext/headers, which is unavailable in the client / Pages Router bundles that also import the package. -
ADDED Generic storefront extension points (seams) in the Next.js storefront for listing/search composition: a pluggable listing data source (default: unified
searchProducts), module-contributed providers / root components / facet renderers, a search-results slot (default: popular searches), a search-form seam (default: submit navigates to the search page), a client-hydration provider, and the storefront event bus. All default to native behaviour when no module is installed, so a store that never installs a search module is unaffected. -
CHANGED The search modal composes a
search-formseam (input + submit) above thesearch-results-slot. The form seam owns submit and reports the live query viaonQueryChange, so a submit-intercepting module (compass — classify the query, open the AI chat) and an as-you-type module (coveo — instant results) plug into the same input independently. Compass now overlays thesearch-formseam instead of the basesearch.tsxcomponent.
Patch Changes
- FIXED
env('NEXT_PUBLIC_*')now returns the correct value on the client during the first render and inside initialuseEffectcalls. Previously, runtime env vars wereundefineduntil shortly after hydration, which could break integrations that read them eagerly — for example, the SAP CDC module'sgetCdcConfig()returned no API key on first render and failed to load the Gigya SDK. - FIXED
AlokaiInstrumentationnow reliably captures the initial page view and any navigation that happens during page load. Previously, the history-trace script started running after hydration, so the very first page view and any router navigation triggered before that point were not reported. - 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. - CHANGED Node engines tightened to
^20.10.0 || >=22.14.0to match the runtime support range for JSON ESM imports withwith { type: "json" }. - Updated dependencies:
- @alokai/connect@2.3.0
- @alokai/instrumentation-next-component@1.0.4
7.0.2
Patch Changes
- FIXED
env('NEXT_PUBLIC_*')now returns the correct value on the client during the first render and inside initialuseEffectcalls. Previously, runtime env vars wereundefineduntil shortly after hydration, which could break integrations that read them eagerly — for example, the SAP CDC module'sgetCdcConfig()returned no API key on first render and failed to load the Gigya SDK. - FIXED
AlokaiInstrumentationnow reliably captures the initial page view and any navigation that happens during page load. Previously, the history-trace script started running after hydration, so the very first page view and any router navigation triggered before that point were not reported. - Updated dependencies:
- @alokai/instrumentation-next-component@1.0.3
7.0.1
Patch Changes
- CHANGED Improve application performance
- Updated dependencies:
- @alokai/instrumentation-next-component@1.0.2
7.0.0
Major Changes
- CHANGEDBREAKING Requires Next@15 - please make sure to update your Next.js version. Now
getRequestHeadersacceptsheadersasHeadersNode type (as per newnext/headerstypings). - CHANGEDBREAKING Update peer dependencies to
Next@15andReact@19. - CHANGEDBREAKING Update package API typings.
Minor Changes
- ADDED Runtime environment variable support via
env()function in@vue-storefront/next. This replaces thenext-runtime-envpackage with a built-in solution that automatically injectsNEXT_PUBLIC_*environment variables into the client-side for runtime access. The new solution provides a unifiedenv()function that works on both server and client, automatic injection ofNEXT_PUBLIC_*variables viaAlokaiProvider, no additional configuration or props needed, and supports runtime environment changes (e.g., in Alokai Console).
Migration Guide
If you're currently using next-runtime-env, follow these steps:
- Update imports
Replace next-runtime-env imports with @vue-storefront/next:
- import { env } from "next-runtime-env";
+ import { env } from "@vue-storefront/next";Files to update:
sdk/options.tsconfig/image-loaders/cloudinary/cloudinary.ts- Any other files using
next-runtime-env
- Add missing imports in
next.config.mjs
If you're using env() in your next.config.mjs, add the import:
+ import { env } from "@vue-storefront/next";
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from 'next/constants.js';
const nextConfig = {
images: env('NEXT_PUBLIC_IMAGE_LOADER_FETCH_URL') ? cloudinaryConfig : defaultImageConfig,
};- Remove
useEnvContextandPublicEnvScript
Remove any usage of useEnvContext() hook:
- import { useEnvContext } from "next-runtime-env";
+ import { env } from "@vue-storefront/next";
export function MyComponent() {
- const env = useEnvContext();
- const apiUrl = env.NEXT_PUBLIC_API_URL;
+ const apiUrl = env("NEXT_PUBLIC_API_URL");
}Remove <PublicEnvScript /> from your layout:
- import { PublicEnvScript } from "next-runtime-env";
export default function RootLayout({ children }) {
return (
<html>
<head>
- <PublicEnvScript />
</head>
</html>
);
}- Remove
next-runtime-envpackage fromapps/storefront-unified-nextjs/package.json
Patch Changes
- FIXED Next.js security fixes
- FIXED Standardize type usage to always reference API type packages across integrations and SDKs.
- Updated dependencies:
- @alokai/connect@2.0.0
- @alokai/instrumentation-next-component@1.0.1
6.1.0
Minor Changes
Introduced Alokai instrumentation support
Patch Changes
- Updated dependencies:
- @alokai/instrumentation-next-component@1.0.0
6.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
createAlokaiMiddlewareto@vue-storefront/next- a wrapper for a Next.js middleware which registers the Alokai-specific logic.
Example usage
// apps/storefront-unified-nextjs/middleware.ts
import { createAlokaiMiddleware } from "@vue-storefront/next";
export default createAlokaiMiddleware(async (request) => {
// your middleware logic
});-
ADDED to
@vue-storefront/nextgetPathnameFromRequestHeadersfunction which allows getting pathname from the request headers during the server side rendering. It requirescreateAlokaiMiddlewareto be used in themiddleware.tsfile. -
ADDED
getSdkmethod has a new configuration option:getLocale. It allows you to pass a function that resolves with locale code which will be used in the next HTTP request:const { getSdk } = createSdk(sdkOptions, getSdkConfig()); const locale = useLocale(); getSdk({ getLocale: () => locale }); -
ADDED - every requests now contains additional "x-alokai-locale" header.
-
ADDED The
x-searchis now appended to NextJS request object inside thecreateAlokaiMiddlewarefunction. -
ADDED The library now re-exports
defineGetConfigSwitcherHeaderfrom@alokai/connect/sdk; -
REMOVED The
getPathnameFromRequestHeadersfunction has been removed from the library. -
ADDED Module-based SDK configuration with
defineSdkModuleand enhanceddefineSdkConfig. This new approach allows for better code organization and reusability of SDK modules. For more details, see the SDK documentation.
Before (all modules inline in the config file)
apps/storefront-unified-nextjs/sdk/config.ts
const config = 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-nextjs/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-nextjs/sdk/modules/index.ts
export * from "./unified";apps/storefront-unified-nextjs/sdk/config.ts
import * as modules from "./modules";
const config = defineSdkConfig(modules);Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0
6.0.0-rc.5
Minor Changes
- ADDED The
x-searchis now appended to NextJS request object inside thecreateAlokaiMiddlewarefunction. - ADDED The library now re-exports
defineGetConfigSwitcherHeaderfrom@alokai/connect/sdk; - REMOVED The
getPathnameFromRequestHeadersfunction has been removed from the library. - ADDED Module-based SDK configuration with
defineSdkModuleand enhanceddefineSdkConfig. This new approach allows for better code organization and reusability of SDK modules. For more details, see the SDK documentation.
Before
const config = 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
const config = defineSdkConfig({
unified,
});Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.4
6.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
createAlokaiMiddlewareto@vue-storefront/next- a wrapper for a Next.js middleware which registers the Alokai-specific logic.
Example usage
// apps/storefront-unified-nextjs/middleware.ts
import { createAlokaiMiddleware } from "@vue-storefront/next";
export default createAlokaiMiddleware(async (request) => {
// your middleware logic
});-
ADDED to
@vue-storefront/nextgetPathnameFromRequestHeadersfunction which allows getting pathname from the request headers during the server side rendering. It requirescreateAlokaiMiddlewareto be used in themiddleware.tsfile. -
ADDED
getSdkmethod has a new configuration option:getLocale. It allows you to pass a function that resolves with locale code which will be used in the next HTTP request:const { getSdk } = createSdk(sdkOptions, getSdkConfig()); const locale = useLocale(); getSdk({ getLocale: () => locale }); -
ADDED - every requests now contains additional "x-alokai-locale" header.
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.3
6.0.0-rc.3
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.2
6.0.0-rc.2
Patch Changes
- Updated dependencies:
- @alokai/connect@1.0.0-rc.1
6.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
6.0.0-rc.0
Major Changes
Replace legacy packages with a connect package
5.1.0
Minor Changes
- CHANGED changed metatags content to fit new company name
5.0.0
Major Changes
- CHANGED The
configparameter available in the callback passed todefineSdkConfig()no longer contains computedmiddlewareUrlproperty. It now exposesapiUrlandssrApiUrlthat should be used instead. - CHANGED The
middleware.ssrApiUrlparameter is now required in theresolveSdkOptions()method.
Migration guide
- Update environment variables
In the apps/storefront-unified-nextjs/sdk/options.ts file, verify the NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL environment variable exists:
const ssrApiUrl = env('NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL');
+ if (!ssrApiUrl) {
+ throw new Error('NEXT_PUBLIC_ALOKAI_MIDDLEWARE_SSR_API_URL is required to run the app');
+ }See our guide on initializing the SDK for a complete version of the file.
- Update SDK configuration file
Update your SDK configuration file (apps/storefront-unified-nextjs/sdk/config.ts) so that registered modules use apiUrl and ssrApiUrl properties instead of middlewareUrl.
import { defineSdkConfig } from '@vue-storefront/next';
export function getSdkConfig() {
return defineSdkConfig(({ buildModule, config, getRequestHeaders, middlewareModule }) => ({
commerce: buildModule(middlewareModule, {
- apiUrl: `${config.middlewareUrl}/commerce`,
+ apiUrl: `${config.apiUrl}/commerce`,
+ ssrApiUrl: `${config.ssrApiUrl}/commerce`,
}),
}));
}4.3.2
Patch Changes
- CHANGED getSdk' getRequestHeaders configuration property now allows you to pass in method returning both headers and cookies of your next application.
4.3.1
Patch Changes
- CHANGED Update JSDoc for
createAlokaiContextmethod.
4.3.0
Minor Changes
ADDED support for the logger utility and createLogger function to initialize the logger on the storefront layer
4.2.0
Minor Changes
- CHANGED
defaultMethodsRequestConfig, so thegetCategory, andgetPagemethods will useGETrequest as a default.
4.1.1
Patch Changes
- CHANGED the package
@vue-storefront/sdkis now a peer dependency instead of dependency
4.1.0
Minor Changes
- [CHANGE]: Added the
resolveSdkOptionshelper that automatically setup proper SSR & SPA URLs for middleware when multistore option is enabled. To use it, change your SDK configuration:
-import type { CreateSdkOptions } from '@vue-storefront/next';
+import { resolveSdkOptions } from '@vue-storefront/next';
-const options: CreateSdkOptions = {
+const options = resolveSdkOptions({
middleware: {
apiUrl,
cdnCacheBustingId,
ssrApiUrl,
},
multistore: {
enabled: isMultiStoreEnabled,
},
});4.0.0
-
ADDED Global State Management with Zustand to improve state organization and sharing across your application.
- Hooks Available:
useSfCartState: Access and update cart state.useSfCustomerState: Manage customer information.useSfCurrencyStateanduseSfCurrenciesState: Handle currency data.useSfLocaleStateanduseSfLocalesState: Manage locale settings.
- State Ready to be Shared with Storefront Modules: Share state seamlessly between Storefront applications and Storefront Modules.
Example Usage:
import { useSfCartState, useSfCustomerState } from "@/sdk/alokai-context"; export default function MyComponent() { const [cart] = useSfCartState(); const [customer] = useSfCustomerState(); return ( <div> <p>Cart: {JSON.stringify(cart)}</p> <p>Customer: {JSON.stringify(customer)}</p> </div> ); } - Hooks Available:
-
CHANGED
createSdkContexttocreateAlokaiContext. It now returns an object with multiple properties instead of an array. The new structure supports both SDK context and the global state management context.Before:
import { createSdkContext } from "@vue-storefront/next/client"; const [SdkProvider, useSdk] = createSdkContext();After:
import { createAlokaiContext } from "@vue-storefront/next/client"; const { AlokaiProvider, useSdk } = createAlokaiContext(); -
REMOVED
SdkProvidercomponent. State management and SDK context are now handled by theAlokaiProvidercomponent. ReplaceSdkProviderwithAlokaiProvideras shown in the Migration Guide.
Patch Changes
- Updated dependencies:
- @vue-storefront/sdk@3.2.0
Migration Guide
To upgrade to version 4.0.0, follow these steps:
1. Replace createSdkContext with createAlokaiContext
Update your imports and change how the context is created.
Before:
import { createSdkContext } from "@vue-storefront/next/client";
const [SdkProvider, useSdk] = createSdkContext();After:
import { createAlokaiContext } from "@vue-storefront/next/client";
const { AlokaiProvider, useSdk } = createAlokaiContext();2. Replace SdkProvider with AlokaiProvider
Wrap your application with the AlokaiProvider component.
Before:
<SdkProvider sdk={getSdk()}>{children}</SdkProvider>After:
<AlokaiProvider
initialData={{
currencies: initialCurrency.currencies,
currency: initialCurrency.currentCurrency,
locale: locale as SfLocale,
locales: locales as SfLocale[],
}}
sdk={getSdk()}
>
{children}
</AlokaiProvider>
);For the App Router you can use the root layout to wrap the application with the AlokaiProvider component and for the Pages Router you can use the Custom App file. You can remove the SdkProvider component. Tip: You can get the initialCurrency by calling sdk.unified.getCurrencies().
3. Remove the sdk-context.tsx file
Replace your custom SDK context file with a new context file using createAlokaiContext.
New alokai-context.tsx:
"use client";
import { createAlokaiContext } from "@vue-storefront/next/client";
import type { Sdk } from "./sdk.server";
import type { SfContract } from "storefront-middleware/types";
export const {
AlokaiProvider,
useSdk,
useSfCartState,
useSfCustomerState,
useSfCurrencyState,
useSfLocaleState,
useSfLocalesState,
} = createAlokaiContext<Sdk, SfContract>();4. Replace useSdk Hook
Update your imports to use the useSdk hook from alokai-context.
Before:
import { useSdk } from "@/sdk/sdk-context";After:
import { useSdk } from "@/sdk/alokai-context";5. Add StateObserver Component
Synchronize query client state with the global state management. Example:
Example:
import { QueryObserver, useQueryClient } from "@tanstack/react-query";
import type { GetCart, GetCustomer } from "@vsf-enterprise/unified-api-sapcc";
import { type PropsWithChildren, useEffect } from "react";
import { useCustomerKey } from "@/hooks";
import {
useSdk,
useSfCartState,
useSfCustomerState,
useSfCurrencyState,
} from "@/sdk/alokai-context";
export default function StateObserver({ children }: PropsWithChildren) {
const sdk = useSdk();
const [, setCustomer] = useSfCustomerState();
const [, setCart] = useSfCartState();
const [, setCurrency] = useSfCurrencyState();
const queryClient = useQueryClient();
const cartObserver = new QueryObserver<Awaited<ReturnType<GetCart>>>(
queryClient,
{
queryFn: () => sdk.unified.getCart(),
queryKey: ["cart", "main"],
},
);
const customerObserver = new QueryObserver<Awaited<ReturnType<GetCustomer>>>(
queryClient,
{
queryFn: () => sdk.unified.getCustomer(),
queryKey: useCustomerKey,
},
);
const currencyObserver = new QueryObserver<
Awaited<ReturnType<GetCurrencies>>
>(queryClient, {
queryFn: () => sdk.unified.getCurrencies(),
queryKey: ["settings", "currencies"],
});
useEffect(() => {
const unsubscribeCart = cartObserver.subscribe(({ data }) => {
setCart(data);
});
const unsubscribeCustomer = customerObserver.subscribe(({ data }) => {
setCustomer(data?.customer);
});
const unsubscribeCurrency = currencyObserver.subscribe(({ data }) => {
setCurrency(data);
});
return () => {
unsubscribeCart();
unsubscribeCustomer();
unsubscribeCurrency();
};
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
return children;
}Place the StateObserver below the AlokaiProvider.
6. Update Locale Management
Whenever the locale changes, update it in the global state using the useSfLocaleState hook.
Example:
import { useSfLocaleState } from "@/sdk/alokai-context";
function updateLocale(newLocale) {
const [, setLocale] = useSfLocaleState();
setLocale(newLocale);
}3.0.1
Patch Changes
FIXED: Added getCurrencies unified endpoint to be fetch by HTTP GET. This change enable caching this endpoint on CDN.
3.0.0
Major Changes
[BREAKING CHANGE]: Now the SDK is separately initialized on the server and client. We recommend splitting configuration files for SDK Options and Configuration to re-use them between instances. Introduce the defineSdkConfig helper function. Changed the SdkProvider interface, taking only type and no arguments. The SDK instance is passed to the Provider in the place where it's used.
Minor Changes
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.
2.1.0
Minor Changes
- ADDED Added .config parameter in createSdk callback
Patch Changes
- Updated dependencies:
- @vue-storefront/sdk@3.1.0
2.0.1
Patch Changes
- Updated dependencies:
- @vue-storefront/sdk@3.0.0
2.0.0
- CHANGED Updated the
@vue-storefront/sdkdependency to version2.0.0. - ADDED
defaultsproperty to the injected context
1.1.1
- FIXED "The inferred type of 'SdkProvider' cannot be named without a reference to (...)" error when calling
createSdkContext.
1.1.0
- ADDED
middlewareModuletocreateSdkparams.
- import { UnifiedApiExtension } from "storefront-middleware/types"
+ import { UnifiedEndpoints } from "storefront-middleware/types"
export const { getSdk } = createSdk(
options,
- ({ 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(),
},
}),
})
);1.0.2
- FIXED Multi-store URL calculation, now working correctly in the browser.
1.0.1
- CHANGED Set
@vue-storefront/sdkas a dependency instead of a peer dependency
1.0.0
- Initialized the package