Skip to main content
Use Unkey Ratelimit when you want a hosted global rate-limit service without provisioning Redis yourself. This guide adapts @unkey/ratelimit to a Redop server.

Install

Add the Unkey package to your Redop app:

Prerequisites

You need:
  • an Unkey account
  • a root key with ratelimit permissions
  • UNKEY_ROOT_KEY in your environment

Create the limiter

Create the limiter once at module scope and use a namespace that clearly matches the part of your app you are protecting.

Add it as Redop middleware

Add timeout and fallback behavior

Unkey’s docs note that the SDK rejects by default if it does not get a response within 5 seconds. Configure timeout and onError if you want fail-open or custom handling.

Use different namespaces for different surfaces

Create separate limiters when different routes or tool families need different policies.
Use the stricter limiter for login, token minting, or verification flows, and the broader limiter for normal API traffic.

When to choose Unkey

Unkey is a strong fit when you want global hosted rate limiting with simple namespaces and per-identifier checks, especially if you already use Unkey for API auth or key management.

See also