---
lang: en
title: 'API docs: express.defineinterceptorprovider'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/express
permalink: /doc/en/lb4/apidocs.express.defineinterceptorprovider.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/express](./express.md) &gt; [defineInterceptorProvider](./express.defineinterceptorprovider.md)

## defineInterceptorProvider() function

Define a provider class that wraps the middleware as an interceptor

**Signature:**

```typescript
export declare function defineInterceptorProvider<CFG, CTX extends Context = InvocationContext>(middlewareFactory: ExpressMiddlewareFactory<CFG>, defaultMiddlewareConfig?: CFG, options?: MiddlewareCreationOptions): Constructor<Provider<GenericInterceptor<CTX>>>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  middlewareFactory | [ExpressMiddlewareFactory](./express.expressmiddlewarefactory.md)<!-- -->&lt;CFG&gt; | Express middleware factory function |
|  defaultMiddlewareConfig | CFG | _(Optional)_ Default middleware config |
|  options | [MiddlewareCreationOptions](./express.middlewarecreationoptions.md) | _(Optional)_ |

**Returns:**

[Constructor](./context.constructor.md)<!-- -->&lt;[Provider](./context.provider.md)<!-- -->&lt;[GenericInterceptor](./context.genericinterceptor.md)<!-- -->&lt;CTX&gt;&gt;&gt;


