Hono

H

Hono

This is the official Hono discord server for the community

Join
Rubyae
Rubyae5/18/2024

Combine JWT middleware with other middleware

I have a file made /middleware/jwt.ts: ```typescript import { Context, Next } from 'hono'; import { jwt } from 'hono/jwt'; ...
Blankeos
Blankeos5/17/2024

Proper error logging and tracing?

Do you guys have an example repo that properly sets up error logs and trace? It seems too difficult to trace here (in the image). As you can see it only traces back to the library-code that threw the error. ...
soufianeelc
soufianeelc5/16/2024

What data should be sent from the client to use clerk middleware?

I'm working on a react-native app using expo. The back-end is built using nodejs & hono. I'm using clerk middleware to handle auth. What data should be sent from the client to authenticate requests(tokens, ids...) ?
Abanob Boles
Abanob Boles5/15/2024

Websocket with Bun

I've tried everything but I can't get WebSockets to work with Bun, also the git issues were not helpful, does anyone have an idea ? ```js import { createBunWebSocket } from "hono/bun"; import wsApp from "./routes/websocket";...
rahmat
rahmat5/15/2024

Custom jwt middleware

I want to check whether the user exists in the database based on the ID that I took from the sub payload using JWT middleware. Anyone can help me for the example code?
Thanzex
Thanzex5/14/2024

Sentry middleware incomplete report

I want to use Hono + Sentry, the target environment is Cloudflare, but for now I'm running it locally. here's a simplified version of my code: ```typescript const app = new Hono<AppType>() app.use(sentry())...
Chicha
Chicha5/14/2024

how i connect my hono application with supabase project

how i connect my hono application with supabase project
igmtink
igmtink5/14/2024

Using hono.js rpc on my expo router project

Is there an example template for this kind of project? I'm trying to use hono rpc to my expo router project, my folder structure is like this: [project name] [client] = (React Native Expo Router)...
No description
Faruq Alli-Balogun
Faruq Alli-Balogun5/14/2024

How can I format response in Hono

I would like my responses to adhere to a particular format, what is the best way to achieve this?
Christer - Codehagen
Christer - Codehagen5/14/2024

Seeking Help with Prisma Accelerate and Hono Setup in Turborepo

Hello, I'm Christer, and I'm currently working on an open-source project using Hono with Prisma. I have everything running on my local server, but I've encountered an issue that I believe might require some tweaking on my end. I'm utilizing a turborepo for this setup, and I suspect that I might need to use Prisma Accelerate to get Hono working properly. Below is the error message I'm seeing:...
No description
igmtink
igmtink5/12/2024

What is the correct project structure for RPC?

I'm working with React Native, and I want to use Hono.js for the backend, is this project structure correct to use RPC? [project name folder] ├── react native folder ├── honojs folder...
Ibnu Rasikh
Ibnu Rasikh5/11/2024

how to stop request that being processing by hono server from client?

i'm thinking about AbortController from vanilla javascript, but it is only aborting the request in the client right? how can i abort the request in the server, which in this case is processed by hono. i only found this [1], but it is used for RPC, in my case hono is run on different server. i also found this issue [2] but i didn't see the abort method. hono v4.3.4 [1] https://hono.dev/guides/rpc#init-option...
No description
theGagne
theGagne5/11/2024

Difficulty using OpenAPI registry parameters with createRoute

My setup is index.ts -> has hono app, imports routes schema.ts -> has zod schemas defined routes.ts -> uses createRoute from defined schemas ...
Jens
Jens5/10/2024

OpenAI Streaming doesn't work

hi, I want to stream the openai response to my frontend. In my frontend, the text is suddenly displayed and is not streamed. In my backend code I see through the consolge log that it outputs the words individually. But in the browser dev tools it looks like the client gets the data all at once. I'm not sure why it doesn't work. Does anyone have a guess? ```ts //backend const res = await openai.chat.completions.create({ model: 'gpt-3.5-turbo',...
soufianeelc
soufianeelc5/9/2024

Error: Missing Clerk Secret key

I'm using clerk with hono middleware to handle auth: https://clerk.com/changelog/2023-11-08 The code is really simple: `import { clerkMiddleware, getAuth } from "@hono/clerk-auth"; import { serve } from "@hono/node-server";...
sps
sps5/9/2024

App breaks in RPC mode, works normally

Hi, as soon as I export the AppType as mentioned in the docs. I start getting this error. If I do not export the AppType and do the normal export default app;, app works fine here is my index.ts ``` import { Context, Hono } from 'hono' import { secureHeaders } from 'hono/secure-headers'...
No description
Erik Giovani
Erik Giovani5/8/2024

Hono with Node

How to get the .env variables from the context in hono with the node tamplate?
mathys
mathys5/8/2024

Websockets

Am I missing something I got this error and I don't found how to fix it with the doc (screenshot from hono node module) I also checked if my setup was correct and it was like this (screenshot where we see initsocket())...
No description
Korny
Korny5/8/2024

Any way to modify the request path in middleware?

(this is cross-posted on https://github.com/orgs/honojs/discussions/2642 - I'm not quite sure which forum we are meant to use? trying both, apologies for the noise) I am trying to replicate a legacy API which had optional versions in paths, so GET /v1/foo actually called GET /foo under the covers. I was hoping to add some middleware that just intercepted paths starting with /v1 and removed the prefix (or re-directed somehow to the correct route) - but it seems that modifying the ctx.req.path does nothing....
jordanthornquest
jordanthornquest5/8/2024

Handling promises resolvers with an in-memory `Map` object

Hello folks, I am developing an app that's using a structure similar to the one in the attached index.ts file. The project I'm building requires starting a request from one client and "confirming" the request from another client. This means that client A must reach out to the /hello-request endpoint, and client B must use /hello-confirm/:helloId to resolve the request. This also works under the assumption that client B would be sent the helloId value in a separate step....
Next