---
title: allowDynamicBackends
summary: Control whether or not Dynamic Backends are allowed within this Fastly Compute service.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/experimental/fn.allowDynamicBackends/
---

**Kind:** Function  
**Module:** [experimental](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/experimental/)  
**Package:** @fastly/js-compute 4.0.1

> **DEPRECATED:** Use enforceExplicitBackends instead.

Control whether or not Dynamic Backends are allowed within this Fastly
Compute service.

By default, Dynamic Backends are disabled within a JavaScript application
as it can be a potential avenue for third-party JavaScript code to send
requests, potentially including sensitive/secret data, off to destinations
that the JavaScript project was not intending, which could be a security
issue.

**Note**: This feature is disabled by default for Fastly Services. Please
contact [Fastly Support](https://support.fastly.com/hc/en-us/requests/new?ticket_form_id=360000269711)
to request the feature be enabled on the Fastly Services which require
Dynamic Backends.

_Overload 1 of 2_

```javascript
allowDynamicBackends(enabled: boolean): void
```

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/experimental.d.ts#L70

Control whether or not Dynamic Backends are allowed within this Fastly
Compute service.

By default, Dynamic Backends are disabled within a JavaScript application
as it can be a potential avenue for third-party JavaScript code to send
requests, potentially including sensitive/secret data, off to destinations
that the JavaScript project was not intending, which could be a security
issue.

**Note**: This feature is disabled by default for Fastly Services. Please
contact [Fastly Support](https://support.fastly.com/hc/en-us/requests/new?ticket_form_id=360000269711)
to request the feature be enabled on the Fastly Services which require
Dynamic Backends.

**Parameters**

- `enabled`: `boolean` — Whether or not to allow Dynamic Backends.

**Returns**

`void`

_Overload 2 of 2_

```javascript
allowDynamicBackends(defaultConfig: { connectTimeout?: number; firstByteTimeout?: number; betweenBytesTimeout?: number }): void
```

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/experimental.d.ts#L80

Enable Dynamic Backends with default timeout configuration.

**Parameters**

- `defaultConfig`: `{ connectTimeout?: number; firstByteTimeout?: number; betweenBytesTimeout?: number }`

  Default timeout configuration for dynamic backends.

  - `connectTimeout` _optional_: `number` — Maximum duration in milliseconds to wait for a connection to be established. 
  - `firstByteTimeout` _optional_: `number` — Maximum duration in milliseconds to wait for the server response to begin after a TCP connection is established and the request has been sent. 
  - `betweenBytesTimeout` _optional_: `number` — Maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend.

**Returns**

`void`

**Throws**

- `RangeError` if any timeout value is negative or greater than or
  equal to 2^32.
