@pubflow/native
v1.0.6
Published
Minutes from idea to a page + API. Hono + TanStack Router + Vite. Same fetch on Node, Bun, Docker, or Cloudflare Workers.
Readme
@pubflow/native
Intermediate stack on Hono, TanStack Router, and Vite. Minutes from idea to a page + /api. The same fetch runs on Node, Bun, Docker, or Cloudflare Workers — Workers is optional. Pages cannot import getDb(). Any TypeScript app can use it; Pubflow auth is optional.
bun add @pubflow/native @tanstack/react-router hono react react-dom
bun add -d viteimport { defineConfig } from 'vite'
import native from '@pubflow/native/vite'
export default defineConfig({
plugins: [native()],
})New app — clone only starter/:
npx degit pubflow/native/starter my-app
cd my-app && bun install && bun run devLayout
app/pages/ React routes — [id].tsx receives { id }
app/api/ Hono → /api/... (.get / .post)
app/lib/ domain code (not mounted)
app/actions/ functions → POST /api/actions/<id>The client build fails if a page imports getDb(). Put secrets in app/api or app/actions. Optional: usePathParams() from this package.
Pubflow Actions are same-origin POST JSON, not RSC and not gRPC. The UI path is HTTP on this process; gRPC can live behind Native later if another service talks to it.
Optional server auth: import { requireAuth, requireRole } from '@pubflow/native/auth' (Flowless). Not pulled into the client. Login UI stays @pubflow/react.
Optional: @pubflow/native/db (Kysely; Hyperdrive on Workers for Postgres/MySQL), ./cache, ./mail, ./rate-limit, ./http (getClientIp, corsFromEnv). Peers are optional.
Docs: github.com/pubflow/native — pages, backend, env, upgrade.
