Safeguard your API endpoints while maintaining optimal performance.
This is a minimal starter template showcasing how to use Unkey for rate limiting in a web server built with the Hono framework, deployed to Cloudflare Workers.
1git clone https://github.com/Devansh-Baghel/hono-unkey-ratelimit-starter.git2cd hono-unkey-ratelimit-starter
Copy the .dev.vars.example
file to .dev.vars
file in the root directory and add your Unkey root key:
1cp .dev.vars.example .dev.vars
Install all dependencies from package.json
:
1npm install
Now start your development server:
1npm run dev
Server will now be running at http://localhost:8787
You will need a cloudflare account for this
1npm run deploy
GET /: A simple welcome message.
GET /secret: This route is rate-limited by Unkey. After exceeding the limit (2 requests in 30 seconds), it returns a 429 Too Many Requests response.
This project is licensed under the MIT License.
2500 verifications and 100K successful rate‑limited requests per month. No CC required.