Skip to content

Implement Rate Limiting by User Tier - #502

Merged
Pidoko257 merged 1 commit into
Pidoko257:mainfrom
hannyloveworld:feat/rate-limiting-by-user-tier
Aug 26, 2026
Merged

Implement Rate Limiting by User Tier#502
Pidoko257 merged 1 commit into
Pidoko257:mainfrom
hannyloveworld:feat/rate-limiting-by-user-tier

Conversation

@hannyloveworld

Copy link
Copy Markdown
Contributor

Summary

This PR implements tiered rate limiting based on user subscription tier (free, pro, enterprise).

Changes

  • src/middleware/rateLimitRedis.ts:
    • Added enterprise tier with higher limits (10000 requests per minute)
    • Refactored tier configuration into TIER_CONFIGS object for easier maintenance
    • Added getLimiter() factory function for lazy initialization of rate limiters
    • Added getTierConfig() and getTierFromRequest() utility functions
    • Updated rate limit response to include tier info, limit, and window duration
    • Supports three tiers:
      • free: 100 requests/minute
      • pro: 1000 requests/minute
      • enterprise: 10000 requests/minute

Issue References

Closes #378
Closes #376
Closes #377
Closes #375

- Add enterprise tier with higher limits (10000 req/min)
- Refactor tier configuration into TIER_CONFIGS object
- Add getLimiter() factory for lazy initialization
- Add getTierConfig() and getTierFromRequest() utilities
- Update rate limit response to include tier info, limit, and window
- Support free (100), pro (1000), and enterprise (10000) tiers

Closes Pidoko257#378
Closes Pidoko257#376
Closes Pidoko257#377
Closes Pidoko257#375
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@hannyloveworld Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Pidoko257
Pidoko257 merged commit ea86c1a into Pidoko257:main Aug 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants