orpc-client-retry-plugin
A plugin for oRPC that enables retrying client calls when errors occur.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
A plugin for oRPC that enables retrying client calls when errors occur.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Quick reference for Better Notify configuration, patterns, and common gotchas
Interactive setup wizard for adding Better Notify to a TypeScript/JavaScript project
Context and API guidance for Better Notify — end-to-end typed notification infrastructure for Node.js
Seamlessly use AI SDK inside your oRPC projects without any extra overhead.
Use oRPC inside an Astro project.
Functions to encode and decode base64url strings (URL-safe variant of base64).
| name | oRPC Client Retry Plugin |
| description | A plugin for oRPC that enables retrying client calls when errors occur. |
| license | MIT |
| metadata | {"author":"Ali Torki","homepage":"https://github.com/ali-master","version":"1.0.0"} |
The Client Retry Plugin enables retrying client calls when errors occur.
import { RPCLink } from '@orpc/client/fetch'
import { ClientRetryPlugin, ClientRetryPluginContext } from '@orpc/client/plugins'
interface ORPCClientContext extends ClientRetryPluginContext {}
const link = new RPCLink<ORPCClientContext>({
url: 'http://localhost:3000/rpc',
plugins: [
new ClientRetryPlugin({
default: {
retry: ({ path }) => {
if (path.join('.') === 'planet.list') return 2
return 0
}
},
}),
],
})
const client: RouterClient<typeof router, ORPCClientContext> = createORPCClient(link)
The
linkcan be any oRPC link —RPCLink,OpenAPILink, or custom implementations.
const planets = await client.planet.list({ limit: 10 }, {
context: {
retry: 3, // Maximum retry attempts
retryDelay: 2000, // Delay between retries in ms
shouldRetry: options => true, // Decide whether to retry
onRetry: (options) => {
// Hook executed on each retry
return (isSuccess) => {
// Execute after the retry is complete
}
},
}
})
Defaults:
retry: 0 (disabled unless explicitly set)retryDelay: (o) => o.lastEventRetry ?? 2000shouldRetry: trueReplicate EventSource behavior:
const streaming = await client.streaming('the input', {
context: { retry: Number.POSITIVE_INFINITY }
})
for await (const message of streaming) {
console.log(message)
}