Skip to content

Connectum API Reference / @connectum/interceptors / defaults / DefaultInterceptorOptions

Interface: DefaultInterceptorOptions ​

Defined in: defaults.ts:42

Configuration options for the default interceptor chain.

Except for fallback and validation, each interceptor can be:

  • false to disable it entirely
  • true to enable with default options
  • An options object to enable with custom configuration

Fallback requires an options object with a handler; boolean values leave it disabled. Validation accepts only a boolean and is enabled unless false.

Only structural interceptors (errorHandler, validation) are enabled by default. Behavioral resilience interceptors (timeout, bulkhead, circuitBreaker, retry) are opt-in: implicitly enabled behavior-altering logic is hidden logic, and hidden logic caused a confirmed production incident (a server-side circuit breaker tripping on expected business errors). Enable each one explicitly where you need it.

Properties ​

bulkhead? ​

optional bulkhead?: boolean | BulkheadOptions

Defined in: defaults.ts:64

Bulkhead interceptor. Limits concurrent requests to prevent resource exhaustion. Opt-in: no hidden behavioral logic.

Default ​

ts
false

circuitBreaker? ​

optional circuitBreaker?: boolean | CircuitBreakerOptions

Defined in: defaults.ts:73

Circuit breaker interceptor. Prevents cascading failures by breaking circuit on consecutive errors. Opt-in: no hidden behavioral logic. Intended primarily for outbound client transports — see the README before enabling it server-side.

Default ​

ts
false

errorHandler? ​

optional errorHandler?: boolean | ErrorHandlerOptions

Defined in: defaults.ts:48

Error handler interceptor (first in chain). Transforms errors into ConnectError with proper codes.

Default ​

ts
true

fallback? ​

optional fallback?: boolean | FallbackOptions<unknown>

Defined in: defaults.ts:90

Fallback interceptor. Provides graceful degradation when service fails. Disabled by default — requires a handler function. Pass an options object with a handler to enable it; true leaves it disabled.

Default ​

ts
false

retry? ​

optional retry?: boolean | RetryOptions

Defined in: defaults.ts:81

Retry interceptor. Retries transient failures with exponential backoff. Opt-in: no hidden behavioral logic.

Default ​

ts
false

serializer? ​

optional serializer?: boolean | SerializerOptions

Defined in: defaults.ts:105

Serializer interceptor (last in chain). Auto JSON serialization for ConnectRPC responses. Disabled by default — enable explicitly when JSON output is needed.

Default ​

ts
false

timeout? ​

optional timeout?: boolean | TimeoutOptions

Defined in: defaults.ts:56

Timeout interceptor. Enforces request deadline before any processing. Opt-in: no hidden behavioral logic.

Default ​

ts
false

validation? ​

optional validation?: boolean

Defined in: defaults.ts:97

Validation interceptor. Validates request messages using @connectrpc/validate.

Default ​

ts
true