/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-if-you-want-to-use--68f453953ea7-if-you-want-to-use-rpc-features-s0079-c0000.md
If you want to use RPC features - hono-docs
If you want to use RPC features Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt if you want to us...
If you want to use RPC features
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#if-you-want-to-use-rpc-features
Summary
The code above works well for normal use cases. However, if you want to use the RPC feature, you can get the correct type by chaining as follows. ```ts // authors.ts import { Hono } from 'hono' const app = new Hono() .get('/', (c) => c...
Content
The code above works well for normal use cases.
However, if you want to use the RPC feature, you can get the correct type by chaining as follows.
// authors.ts
import { Hono } from 'hono'
const app = new Hono()
.get('/', (c) => c.json('list authors'))
.post('/', (c) => c.json('create an author', 201))
.get('/:id', (c) => c.json(`get ${c.req.param('id')}`))
export default app
export type AppType = typeof appIf you pass the type of the app to hc, it will get the correct type.
import type { AppType } from './authors'
import { hc } from 'hono/client'
// 😃
const client = hc<AppType>('http://localhost') // Typed correctlyFor more detailed information, please see the RPC page.