---
title: enforceExplicitBackends
summary: Call this function to enforce the security property of explicitly-defined backends, even when dynamic backends are enabled at the Fastly service level.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/backend/fn.enforceExplicitBackends/
---

**Kind:** Function  
**Module:** [backend](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/backend/)  
**Package:** @fastly/js-compute 4.0.1  
**Since:** 3.24.0  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/backend.d.ts#L64

```javascript
enforceExplicitBackends(defaultBackend?: string): void
```

Call this function to enforce the security property of explicitly-defined backends, even
when dynamic backends are enabled at the Fastly service level.

By default, if dynamic backends are supported for the Fastly service, they will be automatically
used when creating a new `fetch()` request. This default behaviour for dynamic backends can be a
potential security concern since third-party JavaScript code may send arbitrary requests,
including sensitive/secret data, off to destinations that the JavaScript project was not
intending.

When calling this function, an optional default backend name can be provided.

**Parameters**

- `defaultBackend`: `string` (optional) — the name of the default backend to use, when using [fetch()](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/fn.fetch/).

**Returns**

`void`
