# Function: routerType()

> 

> **routerType**\<`TRouter`\>(): [`RouterType`](https://trpc.io/docs/typedoc/client/index/interfaces/RouterType.md)\<`TRouter`\>

Defined in: [packages/client/src/routerType.ts:29](https://github.com/trpc/trpc/blob/5b8ac2f6322053743311f3f21588f99f3ae15e16/packages/client/src/routerType.ts#L29)

Passes a router's type to `createTRPCClient({ router })` as a normal
option, instead of a type argument. Nothing about the router exists at
runtime, so it's safe to import the router's type only.

## Type Parameters

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

## Returns

[`RouterType`](https://trpc.io/docs/typedoc/client/index/interfaces/RouterType.md)\<`TRouter`\>

## Example

```ts
const client = createTRPCClient({
  router: routerType<AppRouter>(),
  links: [httpBatchLink({ url: 'http://localhost:3000/trpc' })],
});
```

## See

https://trpc.io/docs/client/vanilla/setup#3-initialize-the-trpc-client
