Class for dynamically creating new Fastly Backends.

Note

This feature is in disabled by default for Fastly Services. Please contact Fastly Support to request the feature be enabled on the Fastly Services which require Dynamic Backends.

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.

To enable Dynamic Backends the application will need to explicitly allow Dynamic Backends via:

import { allowDynamicBackends } from "fastly:experimental";
allowDynamicBackends(true);

Note: Can only be used when processing requests, not during build-time initialization.

Example

In this example an implicit Dynamic Backend is created when making the fetch request to https://www.fastly.com/ and the response is then returned to the client.

Example

In this example an explicit Dynamic Backend is created and supplied to the fetch request, the response is then returned to the client.

Hierarchy

  • Backend

Constructors

Methods

Constructors

Methods

Generated using TypeDoc