@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
113 lines (55 loc) • 1.79 kB
Markdown
---
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) > [@loopback/context](./context.md) > [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 markdown="1">
target
</td><td markdown="1">
T
</td><td markdown="1">
Target class or object
</td></tr>
<tr><td markdown="1">
context
</td><td markdown="1">
[Context](./context.context.md)
</td><td markdown="1">
_(Optional)_ Context object
</td></tr>
<tr><td markdown="1">
session
</td><td markdown="1">
[ResolutionSession](./context.resolutionsession.md)
</td><td markdown="1">
_(Optional)_ Resolution session
</td></tr>
<tr><td markdown="1">
source
</td><td markdown="1">
[InvocationSource](./context.invocationsource.md)
</td><td markdown="1">
_(Optional)_ Invocation source
</td></tr>
</tbody></table>
**Returns:**
[AsyncProxy](./context.asyncproxy.md)<!-- --><T>