Repository navigation
Rate limiting
Severa allows 10 requests per second and responds with 429 Too Many Requests
(API calls quota exceeded! maximum admitted 10 per 1s.) when the quota is exceeded.
The client now handles this on its own, so callers no longer need to add delays when
looping through paginated results.
Added
- Request pacing. Outgoing requests go through a token bucket, by default 8 requests
per second with a burst capacity of 8, leaving headroom below Severa's quota. - Automatic retry on 429. Rejected requests are retried up to 5 times, using the
Retry-Afterheader when present and exponential backoff (capped at 30s) otherwise.
While waiting, all other requests are held back too, so parallel requests back off
as a whole. - New options:
replenishRate,burstCapacityandmaxRetriesOn429
(set to0to disable retrying). All optional — existing code works unchanged.
Fixed
- Network-level errors (timeouts, connection resets) no longer fail with
TypeError: Cannot read properties of undefined (reading 'status')in the error
handler; the original error is thrown instead.
Notes
- The rate limiter is per client instance. Several clients in the same process share the
same Severa quota, so lowerreplenishRateaccordingly.