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

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [createProxyWithInterceptors](./context.createproxywithinterceptors.md)

## createProxyWithInterceptors() function

Create a proxy that applies interceptors for method invocations

**Signature:**

```typescript
export declare function createProxyWithInterceptors<T extends object>(target: T, context?: Context, session?: ResolutionSession, source?: InvocationSource): AsyncProxy<T>;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

target


</td><td>

T


</td><td>

Target class or object


</td></tr>
<tr><td>

context


</td><td>

[Context](./context.context.md)


</td><td>

_(Optional)_ Context object


</td></tr>
<tr><td>

session


</td><td>

[ResolutionSession](./context.resolutionsession.md)


</td><td>

_(Optional)_ Resolution session


</td></tr>
<tr><td>

source


</td><td>

[InvocationSource](./context.invocationsource.md)


</td><td>

_(Optional)_ Invocation source


</td></tr>
</tbody></table>
**Returns:**

[AsyncProxy](./context.asyncproxy.md)<!-- -->&lt;T&gt;


