Build user-facing React screens against your application’s API. Your server
authenticates the user, selects a scoped broker token, and calls Hookfish. The
browser receives connection metadata, never the broker credential.
Install dependencies
Create the application client
Import the Hono route type exported by your application server. Include
credentials when your application uses cookie sessions.
If your application uses bearer sessions, add the application session token to
this client. Never add a Hookfish broker credential.
Query connections
Use the typed application endpoint in a TanStack Query function.
Create application endpoints for authorization starts and disconnects, then
call them with useMutation. Keep provider-token retrieval and vault-value
access in trusted server code.
@hookfish/hooks targets Hookfish’s optional /api/client facade. Prefer
your own Hono route type for user-facing applications so authentication and
tenant authorization stay in your application.