oRPC Retry After Plugin
Automatically retries requests based on server Retry-After headers.
SKILL.mdskills/orpc-retry-after/SKILL.md
GitHubRetry After Plugin
Automatically retries requests based on server Retry-After headers. Useful for handling rate limiting and temporary server unavailability.
Usage
import { RetryAfterPlugin } from '@orpc/client/plugins'
const link = new RPCLink({
url: 'http://localhost:3000/rpc',
plugins: [
new RetryAfterPlugin({
condition: (response, options) => {
return response.status === 429 || response.status === 503
},
maxAttempts: 5,
timeout: 5 * 60 * 1000,
}),
],
})
Options
condition: Whether a request should be retried. Defaults to429and503status codes.maxAttempts: Maximum retry attempts (default3).timeout: Maximum retry duration in ms (default5 * 60 * 1000).