RaneR
Convex Community13mo ago
8 replies
Rane

How to retrieve remaining rate limits from Convex's rateLimiter?

Hi!

I'm trying to figure out how to get the remaining number of requests allowed with the rateLimiter component. When I use the rateLimiter.limit call, it only tells me whether the limit is OK (ok/retryAfter), but it doesn’t provide how many requests are left.

I noticed that the rateLimiter component has a rateLimits table, which seems to contain the rate limit data. However, when I try to use a query to read this table, I can only access the data from the app component and not the rateLimiter component.

Is there a way to directly query the rateLimiter component’s rateLimits table? Or is there another way to get the remaining request count from rateLimiter.limit?

Thanks in advance for your help!
Was this page helpful?