Custom rate limits #624

Closed
opened 2026-03-13 07:57:28 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @R5dan on GitHub (Feb 4, 2025).

Is this suited for github?

  • Yes, this is suited for github

No response

Describe the solution you'd like

I would like to be able to specify a list of rate limits.

For example:

rateLimits: [
    {
        window: 1,
        max: 3
    },
    {
       window: 60,
       max: 100
    }
]

would let a maximum of 3 requests per second but 100 per minute

Describe alternatives you've considered

You could use custom rateLimits and return the limiting factor, but you would have to implement it and storage yourself. You might as well just make it all yourself in this case.

Additional context

No response

Originally created by @R5dan on GitHub (Feb 4, 2025). ### Is this suited for github? - [x] Yes, this is suited for github ### Is your feature request related to a problem? Please describe. _No response_ ### Describe the solution you'd like I would like to be able to specify a list of rate limits. For example: ```ts rateLimits: [ { window: 1, max: 3 }, { window: 60, max: 100 } ] ``` would let a maximum of 3 requests per second but 100 per minute ### Describe alternatives you've considered You could use `custom rateLimits` and return the limiting factor, but you would have to implement it and storage yourself. You might as well just make it all yourself in this case. ### Additional context _No response_
Author
Owner

@Bekacru commented on GitHub (Mar 25, 2025):

The rate limiting rule is meant to be a simple rate limiter. That’s why we don’t support multiple rate limiting algorithms or other complex use cases. If you need it, you can always provide a custom rule for each path or implement a custom rate limiter ;))

@Bekacru commented on GitHub (Mar 25, 2025): The rate limiting rule is meant to be a simple rate limiter. That’s why we don’t support multiple rate limiting algorithms or other complex use cases. If you need it, you can always provide a custom rule for each path or implement a custom rate limiter ;))
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#624