Skip to content
22 changes: 21 additions & 1 deletion node.js/remote-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ Class `cds.RemoteService` is a service proxy class to consume remote services vi

## cds.**RemoteService** <i> class </i> { #cds-remote-service}

### class cds.**RemoteService** <i> extends cds.Service </i>
### class cds.**RemoteService** <i> extends cds.Service </i>

## cds.RemoteService — Configuration {#remoteservice-configuration }
[remoteservice configuration]: #remoteservice-configuration

The `cds.RemoteService` configuration allows you to define various options for connecting to remote services.

<!--- % assign tx = '<span style="color:grey">srv</span>' %} -->

Expand Down Expand Up @@ -75,6 +76,25 @@ Here, the CSRF-token handling is customized at a more granular level:
- `method`: The HTTP method for fetching the CSRF token. The default is `head`.
- `url`: The URL for fetching the CSRF token. The default is the resource path without parameters.

### Timeout Handling

The `requestTimeout` setting in the `cds.RemoteService` configuration specifies the maximum duration, in milliseconds
(default: 60000), to wait for a response from the remote service before timing out.


#### Configuration Option

```json
{
"API_BUSINESS_PARTNER": {
"kind": "odata",
"credentials": {
...
"requestTimeout": 1000000 // [!code focus]
}
}
}
```

::: tip
See [Using Destinations](../guides/using-services#using-destinations) for more details on destination configuration.
Expand Down