# @purrkit/ratelimit this package provides a rate limiting manager for [@purrkit/rest](https://npmx.dev/@purrkit/rest) ## example usage ```ts import { RESTClient } from "@purrkit/rest"; import { RateLimitManager } from "@purrkit/ratelimit"; const limiter = new RateLimitManager({ onDebug: (msg, data) => { console.log(`[REST] ${msg}`, data || ""); }, onRateLimit: ({ routeId, global, delayMs, bucketHash }) => { const type = global ? "GLOBAL" : "LOCAL"; console.warn( `[RateLimit] Hit ${type} limit on ${routeId}. Pausing for ${delayMs}ms (bucket: ${bucketHash})`, ); }, }); const rest = RESTClient({ token: "...", fetch: limiter.fetch, }); ``` ## copying this project is licensed under the european union public license (eupl) v1.2. you can find the full license text either [here][LISC] or on the official [eupl website][EU], which also contains translations of the license in various languages. [LISC]: ./LICENSE [EU]: https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12