# 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:150](https://github.com/trpc/trpc/blob/a357903312114c6c08952de2c9edc51c713367be/packages/server/src/unstable-core-do-not-import/rootConfig.ts#L150)

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` |
