The purpose of this document is to collect information on the Cloud SDK version 3 to version 4 migration. It should include information on all steps a user needs to take when updating the SDK version from 3 to 4.
This document should be written in a style which addresses the consumer of the SDK. It will eventually end up in the SDK docs portal and release notes for version 4.
Please add your items below when creating a change which will involve manual tasks for the user when performing the upgrade. Add sections to the document as you see fit.
This document will guide you through the steps necessary to upgrade to version 4 of the SAP Cloud SDK. Depending on your project, some steps might not be applicable. The To-Do list is:
- Update Your Project Dependencies
- Update to Node 22 or Newer
- Set
useCacheexplicitly tofalseto turn off destination caching - Set
iasToXsuaaTokenExchangetotrueto enable IAS to XSUAA token exchange - Remove Deprecated Content
Search for occurrences of @sap-cloud-sdk/[some module] in your package.json files.
Replace the version numbers with ^4.
run npm install or similar to install the dependencies and update the lock file.
Running your tests or deploying your application might fail at this point if you need to adapt to any breaking changes. We recommend updating your applications in one commit or pull request and making sure everything still works using your existing test suite.
All SAP Cloud SDK for JavaScript libraries now support node 22 (LTS) as the minimum node version.
If you are using a node version older than 22, update your runtime environment to a newer version.
On Cloud Foundry you can do this by setting the node engine in your package.json.
Destination caching while retrieving destinations via the destination service is now enabled by default.
This change affects the default behviour of getDestination() method, getAllDestinationsFromDestinationService() method, generated client's execute() method and generic HTTP requests execution using executeHttpRequest().
To disable caching set useCache: false in the options, for example in execute() method:
.execute({ destinationName: 'DESTINATION', jwt: 'JWT', useCache: false })Token exchange from IAS to XSUAA is now disabled by default.
Set iasToXsuaaTokenExchange to true explicitly if token exchange is expected.
This change affects the default behaviour of following functions
getDestination()getAllDestinationsFromDestinationService()getDestinationFromDestinationService()useOrFetchDestination()toDestinationNameUrl()buildHttpRequest()executeHttpRequest()executeHttpRequestWithOrigin()
and following methods of request builder
execute()executeRaw()url()
@sap-cloud-sdk/connectivity- The
getAgentConfig()function is now asynchronous. ThegetAgentConfigAsync()function has been removed. - The
destinationForServiceBinding()function has been removed. UsegetDestinationFromServiceBinding()instead. - The
PartialDestinationFetchOptionstype has been removed. Use eitherServiceBindingTransformOptionsorgetDestinationFromServiceBinding()function. - The
serviceToken()function no longer takesxsuaaCredentialsas part of theoptionsparameter. - The
parseDestination()function is no longer a public API. - The
DestinationForServiceBindingOptionsinterface has been renamed toDestinationFromServiceBindingOptions.
- The
@sap-cloud-sdk/odata-common- The
FunctionImportParameterstype has been removed. UseOperationParametersinstead. - The
ODataFunctionImportRequestConfigconstant has been removed. UseODataFunctionRequestConfiginstead. - The
FunctionImportParameterconstant has been removed. UseOperationParameterinstead. - The
ActionFunctionImportRequestBuilderBaseconstant has been removed. UseOperationRequestBuilderBaseinstead.
- The
@sap-cloud-sdk/odata-v2- The
ODataFunctionImportRequestConfigconstant has been removed. UseODataFunctionRequestConfiginstead. - The
FunctionImportRequestBuilderconstant has been removed. UseOperationRequestBuilderinstead.
- The
@sap-cloud-sdk/odata-v4- The
ODataFunctionImportRequestConfigconstant has been removed. UseODataFunctionRequestConfiginstead. - The
ActionImportParameterclass has been removed. UseOperationParameterinstead. - The
ActionImportParameterstype has been removed. UseOperationParametersinstead. - The
FunctionImportRequestBuilderclass has been removed. UseOperationRequestBuilderinstead. - The
BoundFunctionImportRequestBuilderclass has been removed. UseOperationRequestBuilderinstead. - The
BoundActionImportRequestBuilderclass has been removed. UseOperationRequestBuilderinstead. - The
ODataActionImportRequestConfigconstant has been removed. UseODataActionRequestConfiginstead. - The
ODataBoundActionImportRequestConfigclass has been removed. UseODataBoundActionRequestConfiginstead. - The
OdataBoundFunctionImportRequestConfigconstant has been removed. UseODataBoundFunctionRequestConfiginstead. - The
ActionImportRequestBuilderclass has been removed. UseOperationRequestBuilderinstead.
- The
@sap-cloud-sdk/resilience- The
circuitBreakerHttpconstant has been removed. UsecircuitBreakerinstead.
- The
@sap-cloud-sdk/util- The
assocconstant has been removed. There is no replacement.
- The
@sap-cloud-sdk/mail-clientpackage has been removed in v4. As an alternative, implement your own mail client by checking the v3 implementation and the BTP documentation for using the TCP protocol for cloud applications.