# Type Alias: CreateTRPCContextOptions<TSource, TKeyPrefix>

> 

> **CreateTRPCContextOptions**\<`TSource`, `TKeyPrefix`\>: \{ `client`: `never`; `router`: `RouterType`\<`TSource` & `AnyTRPCRouter`\>; \} \| \{ `client`: `TSource`; `router`: `never`; \} & `object`

Defined in: [Context.tsx:95](https://github.com/trpc/trpc/blob/5b8ac2f6322053743311f3f21588f99f3ae15e16/packages/tanstack-react-query/src/internals/Context.tsx#L95)

The options of `createTRPCContext`: the router's type as
`router: routerType<AppRouter>()`, or the client (or the function that
creates it) as `client`, so `trpc.context` is typed from its links.
Only their types are used.

## Type declaration

### keyPrefix?

> `optional` **keyPrefix**: `TKeyPrefix`

`true` prefixes query and mutation keys; `TRPCProvider` then takes the
prefix as `keyPrefix`.

#### See

https://trpc.io/docs/client/tanstack-react-query/usage#keyPrefix

## Type Parameters

| Type Parameter |
| ------ |
| `TSource` *extends* `TRPCContextSource` |
| `TKeyPrefix` *extends* `boolean` |
