What is the feature you are proposing?
Problem:
Issue #1411 requests an officially maintained @hono/rate-limiter middleware, mirroring the community hono-rate-limiter library. The community library is good but having an official package in the @hono namespace matters for enterprise teams who can't use unsigned community packages.
What I want to build:
import { rateLimiter } from '@hono/rate-limiter';
import { RedisStore } from '@hono/rate-limiter/redis';
app.use('/api/*', rateLimiter({
windowMs: 60_000, // 1 minute window
limit: 100, // 100 requests per window
keyGenerator: (c) => c.req.header('x-forwarded-for') ?? 'unknown',
store: new RedisStore({ client: redis }),
onLimitReached: (c) => c.json({ error: 'Rate limit exceeded' }, 429),
}));
Algorithms I'll support:
- Fixed window (default — simplest, stateless counter per window)
- Sliding window (Redis sorted set implementation — accurate, no burst at window boundary)
- Token bucket (smooth rate limiting for burst-tolerant APIs)
Each algorithm is a separate store implementation so users can pick the right tradeoff.
Why official matters:
The honojs org publishing @hono/rate-limiter vs a community package signals that this is the blessed solution. Enterprise teams running Hono on Node.js (not just Cloudflare) need this. I'll follow the exact same adapter pattern as hono-rate-limiter for drop-in compatibility.
This is a companion to the @hono/cache issue I'm also proposing. They share the same Store adapter pattern. Should I submit them as one PR or separately?
What is the feature you are proposing?
Problem:
Issue #1411 requests an officially maintained
@hono/rate-limitermiddleware, mirroring the communityhono-rate-limiterlibrary. The community library is good but having an official package in the@hononamespace matters for enterprise teams who can't use unsigned community packages.What I want to build:
Algorithms I'll support:
Each algorithm is a separate
storeimplementation so users can pick the right tradeoff.Why official matters:
The
honojsorg publishing@hono/rate-limitervs a community package signals that this is the blessed solution. Enterprise teams running Hono on Node.js (not just Cloudflare) need this. I'll follow the exact same adapter pattern ashono-rate-limiterfor drop-in compatibility.This is a companion to the
@hono/cacheissue I'm also proposing. They share the sameStoreadapter pattern. Should I submit them as one PR or separately?