Description
CDS 10 removes the internal CloudSDK HTTP client adapter from @sap/cds and replaces it with native fetch. Projects that relied on CAP's connectivity integration (destination service, principal propagation) using the CloudSDK HTTP client must install the new @cap-js/cloud-sdk proxy package, which bridges the CAP fetch-based HTTP layer with the CloudSDK. Projects that imported @sap-cloud-sdk/http-client or related packages without an explicit dependency entry will also fail to resolve those packages after the upgrade. The connectivity integration itself remains functional through @cap-js/cloud-sdk.
How to Check
- [ ] Search source files for imports of
@sap-cloud-sdk/http-client,@sap-cloud-sdk/core, or other@sap-cloud-sdk/*packages. - [ ] Check
package.jsondependencies— if@sap-cloud-sdk/*packages are used in code but absent frompackage.json, the project relies on transitive deps and will break. - [ ] Search all files (including
package.json, CI configs,mta.yaml) for references to@sap-cloud-sdkto get a full picture. - [ ] Verify whether the project uses CAP destination-based outbound HTTP (via
cds.requires.<service>.destination) — if yes,@cap-js/cloud-sdkis required.
Migration Steps
Add
@cap-js/cloud-sdkto restore CAP connectivity integration with CloudSDK:diff// package.json { "dependencies": { + "@cap-js/cloud-sdk": "^1.0.0" } }If the project imports
@sap-cloud-sdk/http-clientdirectly for outbound calls, add it as an explicit dependency:diff// package.json { "dependencies": { + "@sap-cloud-sdk/http-client": "^3.0.0" } }For simple outbound HTTP calls that do not require destination resolution or principal propagation, replace CloudSDK HTTP client usage with native
fetch:diff- const { executeHttpRequest } = require('@sap-cloud-sdk/http-client'); - const response = await executeHttpRequest({ destinationName: 'MY_DEST' }, { - method: 'GET', - url: '/api/resource', - }); + // Use CAP's destination-aware fetch via cds.connect or fetch directly + const response = await fetch('https://target.example.com/api/resource'); + const data = await response.json();
Notes
The @cap-js/cloud-sdk package is the recommended migration path for applications using SAP BTP destinations, principal propagation, or other CloudSDK connectivity features. Install it alongside @sap-cloud-sdk/http-client rather than replacing that package.