← All Docs
Migration
Migrate from Unkey
Side-by-side code swap from Unkey rate limiting to Brume Limit.
Side-by-side code swap from Unkey rate limiting to Brume Limit.
Unkey's rate-limiting SDK (@unkey/ratelimit) and Brume Limit solve the same problem with similar ergonomics: one client, one call, a verdict. This guide is the side-by-side swap.
| Unkey | Brume Limit | Notes |
|---|---|---|
namespace (created implicitly) | Rule namespace (created explicitly) | Brume rules are created up front, in the dashboard or via API |
limit + duration in the client | limit + window_seconds on the rule | Config lives on the rule, not in code |
rootKey | API key with rate_limit scope | Scoped keys instead of one root key |
| Fixed window / token bucket | Four algorithms | Adds sliding window log and counter |
| Overrage billing | Flat-rate tiers | Exceeding a cap rejects with PLAN_LIMIT, never invoices |
rate_limit-scoped key.duration: '60s' becomes window_seconds: 60.limit(identifier).retry_after. Brume returns retry_after seconds on denial — forward it as the Retry-After header. Unkey's reset is a timestamp; Brume's reset is too, plus the convenience field.degraded: true when its Redis is down, and the SDK adds timeout.fallback / onError knobs. Decide your availability-vs-correctness tradeoff explicitly.