# Type Alias: CreateContextCallback<TContext, TFunction>

> 

> **CreateContextCallback**\<`TContext`, `TFunction`\>: `PartialIf`\<`object` *extends* `TContext` ? `true` : `false`, \{ `createContext`: `TFunction`; \}\>

Defined in: [packages/server/src/unstable-core-do-not-import/rootConfig.ts:161](https://github.com/trpc/trpc/blob/7c907acfd8b31929214792e3b8c2ad7a8ac72563/packages/server/src/unstable-core-do-not-import/rootConfig.ts#L161)

Adds a `createContext` option to an adapter's options. It's optional
when the context is an empty object.

## Type Parameters

| Type Parameter |
| ------ |
| `TContext` |
| `TFunction` *extends* (...`args`) => `any` |
