Skip to main content
Version: v10.0.0

HonoWebSocketPath

Union of the paths a Socket can connect to on a Hono app: every route handled by upgradeWebSocket() , including the basePath() and app.route() prefixes. A :param segment accepts any value, so

/chat/:roomId becomes `/chat/${string}` and /chat/42 matches it.

Hono has no realtime protocol of its own, so this checks the address only. Describe the messages the route sends and receives with ListenerModel and EmitterModel in a createSocketSdk schema.


Import
import { HonoWebSocketPath } from "@hyper-fetch/hono"

Preview​

type HonoWebSocketPath<App> = { [ Path in keyof WebSocketEndpoints<App> & string]: ToPathPattern<Path> }[keyof WebSocketEndpoints<App> & string];