@vsf-enterprise/contentful-api
7.0.0
Minor Changes
- ADDED Error adapter for Contentful client with standardized error normalization.
What changed:
All Contentful client methods now automatically normalize errors to HttpError instances:
- HTTP errors from the API preserve their original status codes
NotFoundErrorfrom SDK maps to 404 Not Found with resource details- Axios errors (if thrown unwrapped by SDK) are normalized with their status codes
- Network and other errors return 502 Bad Gateway
- All errors include
upstream: truemarker and preserve the original error cause for debugging
New exports:
errorAdapter- ProvidescreateNormalizer()andwithErrorNormalizer()methodsContentfulAdapter- Type interface for the error adapter
Migration notes:
The error adapter is automatically applied to clients created via init(). If you have custom error handling logic that depends on catching native Contentful SDK errors directly (e.g., errors with sys.id === 'NotFound' or axios errors), you should now catch HttpError from @alokai/connect/middleware instead. The original error is available via the error.cause property.
Patch Changes
- CHANGED Updated internal dependencies for Yarn 4 compatibility.
- CHANGED Align dependency versions across SDKs, tooling, and shared configs.
- CHANGED Replaced Rollup with tsdown for
@vsf-enterpriseand@alokaipackage builds. - FIXED Standardize type usage to always reference API type packages across integrations and SDKs.
- Updated dependencies:
- @alokai/connect@2.0.0
6.1.1
Patch Changes
- CHANGED Removed deprecated
context.apicalls
6.1.0
Minor Changes
- ADDED
normalizeFilenormalizer which normalizes Contentful's non-image assets. By default it normalizes a file to an object containing assettitle,fileNameandurl. Example:
{
"fileName": "sample-document.pdf",
"title": "Sample PDF Document",
"url": "https://assets.ctfassets.net/test-space/test-file-id/sample-document.pdf"
}
Patch Changes
- Updated dependencies:
- @vsf-enterprise/cms-components-utils@3.1.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.
Patch Changes
- Updated dependencies:
- @vsf-enterprise/cms-components-utils@3.0.0
- @alokai/connect@1.0.0
6.0.0-rc.5
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.
Patch Changes
- Updated dependencies:
- @vsf-enterprise/cms-components-utils@3.0.0-rc.1
- @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:
- @vsf-enterprise/cms-components-utils@3.0.0-rc.0
- @alokai/connect@1.0.0-rc.0
6.0.0-rc.0
Major Changes
CHANGED Replaced core dependencies with a new @alokai/connect package. @vue-storefront/middleware, @vue-storefront/sdk, vue-storefront/logger, vue-storefront/unified-data-model were replaced with @alokai/connect. The replacement preserves the same functionality and interface as the original packages. To read more about the @alokai/connect package, please refer to the documentation. You will also find a migration guide in the documentation.
5.1.0
Minor Changes
- ADDED Support for fetching the preview content dynamically. Set
x-preview=truerequest header to fetch the preview content.
Patch Changes
CHANGED logging level for unified getPage method.
CHANGED deprecated config.preview flag. Please use the x-preview=true request header instead.
FIXED preview host. It is now calculated in a following way:
{
host: `${isPreview ? "preview" : "cdn"}.${config.host ?? "contentful.com"}`;
}
ADDED previewClient to the integration context. To use it, make sure that previewToken is set in the config object.
5.1.0-rc.1
Minor Changes
- ADDED Support for fetching the preview content dynamically. Set
x-preview=truerequest header to fetch the preview content.
5.0.0
Major Changes
CHANGED
- Update
@vue-storefront/middlewareto^5.1.0 - Update
@vue-storefront/unified-data-modelto^3.0.0
4.4.0
Minor Changes
- ADDED You can now specify the full host for the Contentful API. If no host is defined, the API will default to the standard US region (
cdn.contentful.com). By including thepreviewoption in the configuration, you can choose to use preview.contentful.com instead ofcdn.contentful.comas the entry point.
const middlewareConfig = {
integrations: {
cntf: {
location: "@vsf-enterprise/contentful-api/server",
configuration: {
space: TEST_CONTENTFUL_SPACE_ID,
token: TEST_CONTENTFUL_ACCESS_TOKEN,
+ host: "eu.cdn.contentful.com",
},
},
},
};
4.3.0
Minor Changes
- FIXED Fetch first by the exact page URL in
getPage, only then use the resolved URL.
4.2.0
Minor Changes
- CHANGED Upgraded the path-to-regexp package to version
8.0.0. Note that page path patterns must now follow a different convention. For more details, please refer to the Release Notes forpath-to-regexp@8.0.0.
4.1.3
Patch Changes
- Updated dependencies:
- @vsf-enterprise/cms-components-utils@2.0.0
4.1.2
Patch Changes
- CHANGED
getPagemethod requires aunifiedconfiguration withresolvePagesandresolveFallbackPagedefined. - FIXED RegExp path matching in
resolvePages.
4.1.1
Patch Changes
- FIXED Error when using the
getPagemethod with thepaththat doesn't return any data. The method returns now null instead of throwing an error.
4.1.0
Minor Changes
- ADDED Unified extension which allows fetching data from Contentful and extracting components. The extension is available at the
/unifiednamespace and adds two methods: getPage- Fetches the page data from Contentful.normalizePage- Normalizes the raw page data coming from Contentful.
To use the extension on the Storefront side:
- Export extension types in the
storefront-middleware/types.tsfile:
+ export type { UnifiedEndpoints as UnifiedCmsEndpoints } from '@vsf-enterprise/contentful-api';
- In the SDK config, add a new
middlewareModule:
+ import type { UnifiedCmsEndpoints } from 'storefront-middleware/types';
+ unifiedCms: buildModule(middlewareModule<UnifiedCmsEndpoints>, {
+ apiUrl: `${config.middlewareUrl}/cntf/unified`,
+ defaultRequestConfig: {
+ headers: getRequestHeaders(),
+ },
+ }),
// ...
- In your page component, use the
getPagemethod to fetch the page data:
const page = await sdk.unifiedCms.getPage({
path: "/",
locale: "en",
});
All components are extracted, so you don't need to use the extractComponent utility from contentfulModule anymore.
4.0.0
Major Changes
- CHANGED Improved methods documentation present in the
Endpointsinterface. - REMOVED The package no longer exports the
ContentfulMethodsinterface. Use theEndpointsinterface instead. - REMOVED The package no longer exports the
ProxiedEndpointsinterface. Use theApiMethodsinterface instead. - REMOVED The package no longer exports the
ContextualizedEndpointsinterface. Use theApiMethodsinterface instead.
4.0.0-rc.0
Major Changes
- CHANGED Upgraded
@vue-storefront/middlewareto4.x.x - CHANGED Improved methods documentation present in the
Endpointsinterface. - REMOVED The package no longer exports the
ContentfulMethodsinterface. Use theEndpointsinterface instead. - REMOVED The package no longer exports the
ProxiedEndpointsinterface. Use theApiMethodsinterface instead. - REMOVED The package no longer exports the
ContextualizedEndpointsinterface. Use theApiMethodsinterface instead.
3.0.0
Major Changes
- BREAKING Updated
@vue-storefront/middlewareversion to4.1.0. Make sure this version is used in your project.
{
...
"dependencies": {
- "@vue-storefront/middleware": "3.x.x",
+ "@vue-storefront/middleware": "4.1.0"
}
}
2.0.1
Patch Changes
Update axios to ^0.28.0 to mitigate security vulnerability CVE-2023-45857
2.0.0
Major Changes
- CHANGED Changed minimum Node version from 16 to 18. The condition that was forcing the Node version to be lower than 19 is also removed.
1.2.0
Minor Changes
- Bumped
@vue-storefront/middlewareversion to^3.5.0which introduces support for HTTP GET requests.
1.1.0
Minor Changes
- @vsf-enterprise/contentful-api now implements Contentful's Typescript SDK. Methods coming from the SDK client are available as endpoints of Vue Storefront's Server Middleware. For example:
curl --request POST 'http://localhost:8181/cntf/getEntries'
ThegetContentendpoint has been marked as @deprecated and will be removed in 4 years from now (July 2027).
@vsf-enterprise/contentful-sdk has been aligned with the changes in the @vsf-enterprise/contentful-api package. It exposes a proxy for all of the new endpoints. Proxy methods are fully typed and documented with TSDoc.import { sdk } from "~/sdk.config.ts"; const entries = await sdk.contentful.getEntries();
ThegetContentmethod has been marked as @deprecated and will be removed in 4 years from now. - Add node 18 support