Hono

H

Hono

This is the official Hono discord server for the community

Join

How to set "credentials: true" in client side using rpc?

I'm using rpc with react query on the client side, this kind of fetching has already credentials: true?
No description

Cookies doesn't process

When I try to run in my middleware the following ``` setCookie(c, 'test', 'res', { maxAge: 60 * 60 * 24 * 7, httpOnly: true }) console.log(getCookie(c, 'test'));...

use Context to get vars from wrangler.toml

how can fix this code. i want to use my openaiApiKey from the wrangler.toml when i create an openai instance. but i cannot use the context . how can i fix it ?
No description

Connect Hono Cloudflare with MongoDB

Hi. I am using Hono and deploying to Cloudflare. However I am unable to find a way to connect mongodb database using mongoose

Case insensitive query params

We are using hono-zod-openapi to replace an existing API. Sadly the old API (written in ASP.Net) appears to have case-insensitive handling of parameters - and we may need to emulate this. Gah. So we have something like ```...

Password hashing

How to hash password?

How to setup Hono with Remix/Cloudflare for Vite dev server?

From the documentation for Cloudflare Pages, there is an adapter and a plugin, but it is not clear how we can configure both Hono and Remix to run on the Vite dev server. ```ts import devServer from '@hono/vite-dev-server' import adapter from '@hono/vite-dev-server/cloudflare' import build from '@hono/vite-cloudflare-pages'...

Validate response objects

Using the zod validator middleware it is possible to validate params , query, request body like: ``` const route = app.post(...

Hono Oauth Provider with JWT issue

Hey everyone! I'm not sure if this is the right place for me to post about this but recently I wanted to try to use Hono and also saw there was a package for it @hoino/oauth-providers which I also wanted to try. Now I noticed that in my main login.ts route where I use hono/jwt package then I'm getting errors inside my google.ts file where I use the googleAuth from @hono/oauth-providers/google. Currently I'm still using the basic stuff to figure out how things work and how I can use it so don't mind that. This is my /routes/auth/login.ts file...
No description

Deploy Hono / Bun API

I know, I know this is such a newby question but I come from small express apps and other simple ‘click to deploy’ frameworks. I recently discovered Hono and more recently tried to build the app out on Bun because the built in web sockets are amazing. I am just at a loss how to deploy the small API I built. Any insights / examples of how one might deploy a simple API with Hono/Bun would be amazing. I feel like Docker is my best bet but am still not a master with it. Should add, I would appreciate any docs or articles that might help as well. Just excited to push this thing and test it out on a production server. Thanks to all who take the time to read! Best wishes!...

Is there a way to list all request headers ?

I have this use case where I am not sure which header key is being sent, I would like to log all headers to understand more about it.

Typing Middleware JWT and others

Currently I am trying to type the c.get('jwtPayload') that is documented here. I have tried using the method described here in a global.d.ts file but this does not seem to take any affect, the jwtPayload get result is still typed as any. Currently I have removed the global.d.ts file and set types on the Hono instance instead so its more explicit. This is still not working for the jwtPayload (and other values I use in middelware like the oauth middleware): ```typescript...

How to generate openapi.yaml spec with Zod OpenAPI Hono?

Is it possible to generate the openapi.yaml spec with Zod OpenAPI Hono from the commandline using a npm command? I need this in my development workflow to use the openapi.yaml to generate some other client code from the spec....

Why use Hono for Next.js backend (route handlers)?

I'm creating a full-stack web app and probably using Next.js API/route handler: https://nextjs.org/docs/app/building-your-application/routing/route-handlers I saw that Hono has a page about supporting it: https://hono.dev/getting-started/vercel#_2-hello-world I'm curious what the point of using Hono in Next.js' route handlers is, instead of just using Next.js' default route handler (using 2 solutions (both support HTTP requests/responses) instead of simply 1)? Is it because the developer may prefer Hono's syntax? (FYI I'm not very familiar with backend development)...

Context not finalized

Im trying to build a S3 API and it returns this on every requests
Error: Context is not finalized. You may forget returning Response object or `await next()`
Error: Context is not finalized. You may forget returning Response object or `await next()`
...

Type checking with Hono + prisma + zod -> return json date (expect string)

HI, i m usin openAPi I declared return params in my route ``` const getUserRoute = createRoute({ method: 'get',...

Deploying Hono App to Multiple Runtimes

How can I deploy my Hono app to multiple different runtimes simultaneously within the same project? For example: Vercel Edge Functions, Netlify Edge Functions, and Fastly Compute.

Sourcemap Support for Sentry Middleware

There's some way to improve the DX of using Sentry with Hono? I'm receiving the issues on my Sentry dashboard, but the trace doesn't say anything where the error came from.

Does Hono Cloudflare Pages work with `@supabase/supabase-js`?

Logs These were my errors on bun run dev, full logs attached. ```bash 9:21:29 PM [vite] Error when evaluating SSR module /node_modules/@supabase/node-fetch/lib/index.js: |- ReferenceError: exports is not defined...

Welcome To The Hono Help Forum

Welcome to the dedicated forum for Hono help. This platform is designed to ensure your questions about Hono are seen and addressed in a timely manner. If you have a question, please feel free to post it here. This forum serves as a direct line to finding the answers you need. The previous help channel has been renamed to "quick-questions." So all information shared there has been preserved and will remain accessible. If you find the solution to your query, you're encouraged to close your thread. This action helps us maintain a clean and organized forum....