Skip to main content
Mount Hookfish below /api with an optional catch-all App Router route. The handler uses the Node.js runtime so it can use the database adapters and provider SDKs included with Hookfish.

Install dependencies

Create hookfish.config.ts using the same configuration shown in the Hono guide. Use PGlite only for local development or a single persistent Node process. Use PostgreSQL for horizontally scaled or ephemeral deployments.

Create the route handler

Create app/api/[[...path]]/route.ts:
Adjust the relative config import to match your project structure.

Add authenticated application routes

Keep user authentication in normal Next.js route handlers. After validating the session and permissions, use the typed Hono client to call Hookfish from the server:
Place this handler at an application-owned path such as /api/integrations/connections. The browser sends its normal Next.js session to that path and never receives the broker token. See Application authentication for the Hono RPC pattern and tenant-isolation guidance.