---
lang: en
title: 'API docs: context.inject.context'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.context.inject.context.html
---

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

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

## inject.context variable

Inject the context object.

<b>Signature:</b>

```typescript
context: () => (target: Object, member: string, methodDescriptorOrParameterIndex?: number | TypedPropertyDescriptor<any> | undefined) => void
```

## Example


```ts
class MyProvider {
 constructor(@inject.context() private ctx: Context) {}
}

```


