@inkly/hono
v0.0.0
Published
Hono framework embedding adapter for inkly (cross-runtime upgradeWebSocket).
Readme
@inkly/hono
Hono adapter helpers for inkly. On Node, the intended integration is to start Hono with @hono/node-server, then attach inkly to the same returned Node http.Server so HTTP and WebSocket traffic share one port.
Install
pnpm add @inkly/hono @inkly/core @inkly/client honoFor Node embedding, also provide @hono/node-server, @inkly/node, and ws in the consuming app.
Quickstart
import { serve } from "@hono/node-server";
import { Hono } from "hono";
import { attachInkly } from "@inkly/node";
import { contract, inkly } from "@inkly/core";
import { inklyHono } from "@inkly/hono";
const api = contract({ actions: {}, events: {} });
const ws = inkly(api);
const app = new Hono().get("/health", (c) => c.json({ ok: true }));
inklyHono(app, ws, { serve, attachInkly, port: 3000, path: "/ws" });API
inklyHono(honoApp, inklyApp, options)starts Hono through an injected Nodeservefunction, attaches inkly, and returns{ server, handle, port, close() }.serveHonois an alias.createHonoWebSocketBridge()is a lower-level helper for runtimes where Hono's nativeupgradeWebSocket()owns the upgrade.
Caveats
@hono/node-server is not bundled here. If it is unavailable, use dependency injection as shown or Hono's native websocket bridge. Node e2e coverage requires @hono/node-server; this package's local test uses fake-injected wiring when it is absent.
