Skip to main content
Protect your Cloudflare Workers with Unkey’s globally distributed verification.

Install

Basic Worker

src/index.ts

Configure Secrets


With Hono

For a cleaner routing experience, use Hono:
src/index.ts

Reusable Auth Middleware

Create a clean middleware pattern:
src/middleware/auth.ts
Use it:
src/index.ts

Rate Limit Headers

Add standard rate limit headers:
src/middleware/auth.ts

With Durable Objects

For stateful applications with Durable Objects:
src/index.ts

wrangler.toml

wrangler.toml

Deploy

Your API is now protected globally with Unkey! 🌍
Last modified on May 20, 2026