# createContext

```ts
function createContext<T>(key: string, defaultValue?: T): Context<T>
```

### Type Parameters
T


### Parameters


**key**: string


**defaultValue**<span class="inline-block bg-sky-100 rounded px-2 text-sm text-sky-900 mx-1">optional</span>: T
### Return Type


[Context](https://frontside.com/effection/api/v3/Context.md)&lt;T&gt;

[View code](https://github.com/thefrontside/effection/tree/effection-v3.6.1/lib/context.ts#L5)
