MiddlewareConfig
interface MiddlewareConfig<TIntegrationsContext extends Record<string, IntegrationContext> = Record<string, IntegrationContext>> {
errorHandler?: ErrorHandler;
helmet?: boolean | Readonly<HelmetOptions>;
integrations: Integrations<TIntegrationsContext>;
logger?: LoggerOptions;
}Properties
| Name | Required | Type | Description |
|---|---|---|---|
errorHandler | Optional | ErrorHandler | Global error handler for all integrations. When to use: Define this in middleware.config.ts when you want consistent error handling across all integrations. Individual integrations can still override this with their own handler. Priority: Integration-specific > Global > Built-in default Scope: Only handles errors from integration endpoints (/:integrationName/*). Errors from non-integration routes (e.g., /healthz or custom routes) are not handled by this. Handles: API errors, body parser errors (invalid JSON), and other middleware errors that occur during integration endpoint execution. |
helmet | Optional | boolean | Readonly<HelmetOptions> | |
integrations | Required | Integrations<TIntegrationsContext> | |
logger | Optional | LoggerOptions |
Referenced Types
- IntegrationContext
- ErrorHandler
HelmetOptions- Integrations
- LoggerOptions