Function withRateLimiting
- with
Rate <T>(config, credentialKey, fn): Promise<T>Limiting Type Parameters
T
Parameters
config: RateLimitConfig
Rate limiting configuration
credentialKey: string
The credential key for the API
fn: (() => Promise<T>)
The async function making the API call
- (): Promise<T>
Returns Promise<T>
Returns Promise<T>
The result of the API call
Throws
Error if rate limit is exceeded or max wait time is reached
Wrapper function to handle rate limiting for any API call