Added the rate limit middleware.

This commit is contained in:
javier committed 2026-10-25 18:14:19 +01:00
1 parent 35b3b7953d
commit 2d86dff608
4 files changed
+326

No files matched your search

@@ -63,6 +63,17 @@ repeat {
} while cursor != nil
```
### Handling Rate Limits
Add ``RateLimitMiddleware`` before the authentication middleware to retry `429 Too Many Requests` responses:
```swift
middlewares: [
RateLimitMiddleware(),
BearerAuthMiddleware { try await tokenProvider.token() }
]
```
## Topics
### API Client
@@ -75,6 +86,10 @@ repeat {
- ``BearerAuthMiddleware``
- ``APIKeyTokenProvider``
### Rate Limiting
- ``RateLimitMiddleware``
### Generated Types
- ``Components``