/Knowledge/sources/honojs__hono/llms-full/best-practices-building-a-larger-application-if-you-want-to-use-rpc-features--f4f37df121fa.md

Best Practices: Building a larger application > If you want to use RP...

Best Practices: Building a larger application If you want to use RPC features Source evidence: /Sources/honojs hono/provenance.md Canonical citation: https:/...

Best Practices: Building a larger application > If you want to use RPC features

Source evidence: /Sources/honojs__hono/provenance.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 app

If 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 correctly

For more detailed information, please see the RPC page.

Metadata

{
  "chunk_index": 0,
  "citation": "https://hono.dev/llms-full.txt#if-you-want-to-use-rpc-features",
  "coverage_role": "overview",
  "qualified_title": "Hono / llms-full / Best Practices > Building a larger application > If you want to use RPC features",
  "retrieved_at": "2026-07-02T05:51:01Z",
  "section_index": 79,
  "source_id": "/honojs/hono",
  "source_type": "llms_full",
  "target_label": "llms-full",
  "title": "Best Practices: Building a larger application > If you want to use RPC features",
  "upstream_url": "https://hono.dev/llms-full.txt",
  "version": "2026"
}
Kinic Wiki
Loading knowledge node
Details

Identity

database
db_23dhmsxlhukv
database_id
db_23dhmsxlhukv
path
/Knowledge/sources/honojs__hono/llms-full/best-practices-building-a-larger-application-if-you-want-to-use-rpc-features--f4f37df121fa.md
kind
directory
role
markdown_note
children
0

Metadata

created_at
virtual
updated_at
virtual
etag
virtual
metadata_json
{}

Lint Hints

No lightweight warnings.

Outgoing Links

No outgoing links indexed.

Incoming Links

Select a file node to inspect backlinks.

Raw Source

No raw source path inferred.