{"repo":"rayriffy/elysia-rate-limit","free":true,"listed":false,"github":"https://github.com/rayriffy/elysia-rate-limit","clone":"git clone https://github.com/rayriffy/elysia-rate-limit.git","description":"Lightweight rate limiter plugin for Elysia.js","language":"TypeScript","stars":238,"topics":["elysia","rate-limit","rate-limiting","api","bun","middleware","elysia-plugin"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Elysia Rate Limit Lightweight rate limiter plugin for Elysia.js Install If you're using Elysia v2.0.0 or higher, you should use elysia-rate-limit v5.0.0 or higher. If you're using Elysia v1.0.0, you should use version 4.6.3 or lower. Compatibility As long as you're on the latest version of Bun, and Elysia. Using the latest version of elysia-rate-limit would works just fine. However, please refer to the following table to determine which version to use. Plugin version Requirements ---------------- ------------------------------ 5.0.0+ Bun 1.0.3, Elysia = 2.0.0 3.0.0 - 4.6.3 Bun 1.0.3, Elysia = 1.0.0 2.0.0 - 2.2.0 Bun 1.0.3, Elysia number Promise ) Default: 60000 Duration for requests to be remembered in milliseconds . Also used in the Retry-After header when the limit is reached. Can be a static number or a dynamic function that returns the duration based on the client key and request. The function receives: - key : The generated client key (e.g., IP address) - request : The request object with cookies attached Note: The dynamic value is resolved when a new window opens for a given key. Changing the duration mid-window has no effect on the current window — it will apply on the next window. Example for static duration Example for dynamic duration max number ((key: string, request: ExtendedRequest) = number Promise ) Default: 10 Maximum of request to be allowed during 1 duration timeframe. Can be a static number or a dynamic function that returns the max based on the client key ","default_branch":null,"files":null,"tree":[],"storefront":"/r/rayriffy","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/rayriffy/elysia-rate-limit/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}