Skip to content

PluginSetupContext

PluginSetupContext<TRequires, TEnv> = object & TRequires

Defined in: packages/core/src/types.ts:36

The context object passed to a plugin’s setup() function.

Contains the current request, validated env, and all values provided by prior plugins (typed via TRequires).

By default env is typed as the loose Record<string, unknown> shape used by the framework’s generic plugin layer. Consumer apps that want precise bindings (e.g. Cloudflare.Env from worker-configuration.d.ts) can specialise the type via definePluginFor or by importing the PluginContext helper directly.

env: TEnv

The validated environment bindings.

request: Request

The incoming HTTP request for the current invocation.

TRequires

Intersection of prior plugin provides (e.g., AuthPluginProvides).

TEnv = Record<string, unknown>

Env shape (defaults to the loose record shape).