# Type Alias: LocalLinkOptions<TRouter>

> 

> **LocalLinkOptions**\<`TRouter`\>: `object` & `TransformerOptions`\<`inferClientTypes`\<`TRouter`\>\>

Defined in: [packages/client/src/links/localLink.ts:55](https://github.com/trpc/trpc/blob/57482b0bb09dce5c838dc8bf5727a943488bac61/packages/client/src/links/localLink.ts#L55)

Options for [localLink](https://trpc.io/docs/typedoc/client/index/functions/localLink.md).

## Type declaration

### createContext()

> **createContext**: (`opts`) => `Promise`\<`inferRouterContext`\<`TRouter`\>\>

Creates the context for each call. `info.signal` aborts when the call
is cancelled.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `opts` | [`LocalLinkCreateContextOptions`](https://trpc.io/docs/typedoc/client/index/type-aliases/LocalLinkCreateContextOptions.md) |

#### Returns

`Promise`\<`inferRouterContext`\<`TRouter`\>\>

#### See

https://trpc.io/docs/client/links/localLink#createcontext

### onError()?

> `optional` **onError**: (`opts`) => `void`

Called when a procedure throws.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `opts` | `ErrorHandlerOptions`\<`inferRouterContext`\<`TRouter`\>\> |

#### Returns

`void`

#### See

https://trpc.io/docs/client/links/localLink#onerror

### router

> **router**: `TRouter`

The router to call.

#### See

https://trpc.io/docs/client/links/localLink#router

## Type Parameters

| Type Parameter |
| ------ |
| `TRouter` *extends* `AnyRouter` |

## See

https://trpc.io/docs/client/links/localLink#options
