Skip to main content

Functions

withMiddleware

Setup a execution chain of middleware functions. Returns: RequestMiddleware

withProxy

Returns: RequestMiddleware

Types

RequestConfig

A request configuration object. Note: This is a simplified version of the RequestConfig type from the fetch API. It contains only the properties that are relevant for the fal client. It also works around the fact that the fetch API Request does not support mutability, its clone method has critical limitations to our use case.

RequestMiddleware

ProxyRuntimeEnv

Runtime information passed to a user-provided predicate so it can decide whether the proxy middleware should apply.

ProxyRuntimeGate

Controls when the proxy middleware applies:
  • "browser" — only when a DOM window is available (default).
  • "always" — in every runtime (Node, Electron, Bun, workers, etc.).
  • A predicate receiving — full control per call.

RequestProxyConfig