Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
796e09b
docs: document native BTP Destination Service client for Node.js
schwma Sep 7, 2026
93a1f09
docs: move destination docs to service-bindings, revert consuming-ser…
schwma Sep 7, 2026
c4c9722
docs: fix destination intro sentence to match existing wording
schwma Sep 7, 2026
44348dc
docs: move native fetch to node.js/remote-services, link from to-cf
schwma Sep 7, 2026
b3041b2
docs: merge Cloud SDK and native fetch sections in to-cf.md
schwma Sep 7, 2026
f673da8
docs: beta tag on native fetch headings, remove tenant resolution par…
schwma Sep 7, 2026
ed1e362
docs: refine native fetch config and timeout documentation
schwma Sep 9, 2026
11dcf20
docs: fix snippet style and content in service-bindings.md
schwma Sep 9, 2026
6703c1a
docs: use lowercase 'Destination service' in body text
schwma Sep 9, 2026
2a9407c
docs: remove caching section from native fetch destinations
schwma Sep 9, 2026
8b3089c
docs: fix whitespace in consuming-services.md
schwma Sep 9, 2026
00ff097
docs: clean up native fetch destination section formatting
schwma Sep 9, 2026
ca7861b
docs: fix broken native-fetch link in service-bindings.md
schwma Sep 9, 2026
381187a
Newline
schwma Sep 9, 2026
b74e42f
docs: refine HTTP client section wording and formatting
schwma Sep 9, 2026
190d14b
docs: split remote service consumption intro into two paragraphs
schwma Sep 9, 2026
357dfcf
docs: simplify client selection sentence
schwma Sep 9, 2026
44aa0c9
docs: reword destination and application-defined destination intros
schwma Sep 10, 2026
c59cfb4
docs: reword application-defined destinations intro
schwma Sep 10, 2026
4011813
docs: use SAP BTP consistently throughout
schwma Sep 10, 2026
99a743f
docs: reword destinations intro sentence
schwma Sep 10, 2026
d026436
docs: fix consecutive CAP supports paragraphs
schwma Sep 10, 2026
826ef54
docs: refine wording and phrasing
schwma Sep 10, 2026
0fa929b
Merge branch 'main' into feat/native-fetch-destination-docs
schwma Sep 10, 2026
7b0ca20
cosmetics
smahati Sep 10, 2026
9ddf391
cosmetics
smahati Sep 10, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions guides/deploy/to-cf.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,9 @@ The roles/scopes are derived from authorization-related annotations in your CDS

### 3. Remote Service Consumption {#remote-services}

CAP supports two HTTP clients for remote service calls.
CAP supports two HTTP clients for remote service calls: [SAP Cloud SDK](../../node.js/remote-services#sap-cloud-sdk) and CAP's built-in [native fetch client](../../node.js/remote-services#native-fetch).

#### SAP Cloud SDK {#add-cloud-sdk}

If you intend to consume remote services in production, for example, via [BTP Destinations](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/destination-service), add the requisite SAP Cloud SDK packages, like that for Node.js:
If you need full SAP BTP Destination service support including on-premise connectivity, add the SAP Cloud SDK packages:

```shell
npm add @sap-cloud-sdk/connectivity
Expand All @@ -145,19 +143,9 @@ npm add @sap-cloud-sdk/resilience

[Learn more about consuming remote services with SAP Cloud SDK.](https://sap.github.io/cloud-sdk/docs/js/overview){.learn-more}

#### Native Fetch Client <Beta /> {#native-fetch}

CAP provides a built-in remote client that uses the native Node.js `fetch` API. For limitations, see the warning below. During local development, you don't need SAP Cloud SDK, but you can still use it. For production, you still need SAP Cloud SDK. For example, you use it to resolve named destinations through the SAP BTP Destination service.

CAP selects the native fetch client for each outgoing request according to the following rules:
Alternatively, CAP's built-in native fetch client supports SAP BTP destinations without SAP Cloud SDK.

1. If the destination requires features only available in SAP Cloud SDK (for example, SAP BTP Destination service resolution or non-basic authentication), CAP always uses SAP Cloud SDK.
2. If you explicitly set <Config>cds.remote.native_fetch</Config> to `true` or `false`, CAP uses that setting.
3. Otherwise, CAP uses native fetch when you haven't installed `@sap-cloud-sdk/http-client`.

::: warning Current limitations
The native fetch client does not yet support named destinations using the SAP BTP Destination service. It supports only [application-defined destinations](../services/consuming-services#use-application-defined-destinations). In addition, it limits authentication to `NoAuthentication` and `BasicAuthentication`.
:::
[Learn more about the native fetch client.](../../node.js/remote-services#native-fetch){.learn-more}


### 4. MTA-Based Deployment {#add-mta-yaml}
Expand Down
118 changes: 118 additions & 0 deletions guides/integration/service-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,123 @@ cds env requires -b

## Destinations

Destinations provide the connectivity details needed to reach a remote system, essentially a named URL enriched with metadata such as authentication configuration.

@schwma schwma Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: Parts of this section were adapted from consuming-services.md


CAP supports named destinations from the [SAP BTP Destination service](#btp-destination-service) as well as [application-defined destinations](#application-defined-destinations) configured directly in your project.

### SAP BTP Destination Service {#btp-destination-service}

Named destinations are resolved from the SAP BTP Destination service. Configure the destination name in the `credentials` block of the required service:

```json
"cds": {
"requires": {
"API_BUSINESS_PARTNER": {
"kind": "odata",
"model": "srv/external/API_BUSINESS_PARTNER",
"[production]": {
"credentials": {
"destination": "S4HANA",
"path": "/sap/opu/odata/sap/API_BUSINESS_PARTNER"
}
}
}
}
}
```

Bind the Destination service to your application:

```sh
cds add destination
```

#### Native Fetch Client <Beta /> {#native-fetch-destinations}

When the [native fetch client](../../node.js/remote-services#native-fetch) is active, CAP resolves SAP BTP destinations natively without SAP Cloud SDK.

**Supported authentication types:**

| Authentication | Supported |
|---|:---:|
| `NoAuthentication` | ✓ |
| `BasicAuthentication` | ✓ |
| `OAuth2ClientCredentials` | ✓ |

**Configuration:**

| Property | Default | Description |
|---|---|---|
| `timeout` | `'10s'` | Timeout for SAP BTP Destination service and token requests |

```json
"cds": {
"remote": {
"native_fetch": true,
"timeout": "30s"
}
}
```

::: warning Proxy type limitation
Only destinations with proxy type `Internet` are fully supported. On-premise destinations (proxy type `OnPremise`) require SAP Cloud SDK.
:::

#### SAP Cloud SDK

When the native fetch client isn't active, CAP uses the SAP Cloud SDK to resolve SAP BTP destinations. Additional `destinationOptions` can be passed to control resolution behavior:

```jsonc
"cds": {
"requires": {
"API_BUSINESS_PARTNER": {
/* ... */
"[production]": {
"credentials": {
/* ... */
},
"destinationOptions": {
"selectionStrategy": "alwaysSubscriber",
"useCache": true
}
}
}
}
}
```

[Learn more about destinations with SAP Cloud SDK.](../services/consuming-services#use-sap-btp-destinations){.learn-more}

### Application-Defined Destinations {#application-defined-destinations}

If you don't want to use SAP BTP destinations, you can define the URL, authentication details, and additional metadata directly in your CAP configuration:

```json
"cds": {
"requires": {
"REVIEWS": {
"kind": "odata",
"model": "srv/external/REVIEWS",
"[production]": {
"credentials": {
"url": "https://reviews.ondemand.com/reviews",
"authentication": "BasicAuthentication",
"username": "<set from code or env>",
"password": "<set from code or env>",
"headers": {
"my-header": "header value"
},
"queries": {
"my-url-param": "url param value"
}
}
}
}
}
}
```

[Learn more about application-defined destinations.](../services/consuming-services#use-application-defined-destinations){.learn-more}

## Service Keys
## Using API Keys
6 changes: 3 additions & 3 deletions guides/services/consuming-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ External service definitions, like [generated CDS or CSN files during import](#i
It's best practice to use your own "interface" to the external service and define the relevant fields in a projection in your namespace. Your implementation is then independent of the remote service implementation and you request only the information that you require.

```cds
using {  API_BUSINESS_PARTNER as bupa } from '../srv/external/API_BUSINESS_PARTNER';
using { API_BUSINESS_PARTNER as bupa } from '../srv/external/API_BUSINESS_PARTNER';

entity Suppliers as projection on bupa.A_BusinessPartner {
key BusinessPartner as ID,
Expand Down Expand Up @@ -590,7 +590,7 @@ What you need to do depends on [the scenarios](#sample-scenario-from-end-to-end-
To expose a remote service entity, you add a projection on it to your CAP service:

```cds
using {  API_BUSINESS_PARTNER as bupa } from '../srv/external/API_BUSINESS_PARTNER';
using { API_BUSINESS_PARTNER as bupa } from '../srv/external/API_BUSINESS_PARTNER';

extend service RiskService with {
entity BusinessPartners as projection on bupa.A_BusinessPartner;
Expand Down Expand Up @@ -680,7 +680,7 @@ module.exports = cds.service.impl(async function() {
It's possible to expose associations of a remote service entity. You can adjust the [projection for the association target](#model-projections) and change the name of the association:

```cds
using { API_BUSINESS_PARTNER as bupa } from '../srv/external/API_BUSINESS_PARTNER';
using { API_BUSINESS_PARTNER as bupa } from '../srv/external/API_BUSINESS_PARTNER';

extend service RiskService with {
entity Suppliers as projection on bupa.A_BusinessPartner {
Expand Down
28 changes: 27 additions & 1 deletion node.js/remote-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,32 @@ The `cds.RemoteService` configuration allows you to define various options for c
<!--- % assign tx = '<span style="color:grey">srv</span>' %} -->


### HTTP Client {#http-client}

CAP supports two HTTP clients for outgoing remote service calls: [SAP Cloud SDK](#sap-cloud-sdk) and CAP's built-in [native fetch client](#native-fetch).

#### SAP Cloud SDK {#sap-cloud-sdk}

If the SAP Cloud SDK HTTP client (`@sap-cloud-sdk/http-client`) is installed, CAP uses it by default. The client provides full support for all SAP BTP Destination service features including on-premise connectivity.

[Learn more about SAP Cloud SDK.](https://sap.github.io/cloud-sdk/docs/js/overview){.learn-more}

#### Native Fetch Client <Beta /> {#native-fetch}

CAP provides a built-in remote client that uses the native Node.js `fetch` API, including support for resolving named destinations from the SAP BTP Destination service.

::: warning Current limitations
The native fetch client supports only proxy type `Internet` and authentication types `NoAuthentication`, `BasicAuthentication`, and `OAuth2ClientCredentials`. Other authentication types are resolved on a best-effort basis via the native destination client.
:::

You don't need SAP Cloud SDK for local development. For production, the SAP Cloud SDK is only required if you use authentication types or proxy configurations not yet supported by the native client.

The client selection follows this priority:

1. **Explicit configuration** - set <Config>cds.remote.native_fetch</Config> to `true` or `false`, CAP uses that setting.
2. **Default behavior** - CAP uses native fetch when you haven't installed `@sap-cloud-sdk/http-client`.

[Learn more about SAP BTP Destination service support for the native fetch client.](../guides/integration/service-bindings#native-fetch-destinations){.learn-more}

### CSRF-Token Handling

Expand Down Expand Up @@ -94,7 +120,7 @@ The `requestTimeout` setting in the `cds.RemoteService` configuration specifies
```

::: tip
See [Using Destinations](../guides/services/consuming-services#using-destinations) for more details on destination configuration.
See [Using Destinations](../guides/integration/service-bindings#destinations) for more details on destination configuration.
:::

## <i> More to Come </i>
Expand Down
Loading