Skip to content
oRPC
Esc
navigateopen⌘Jpreview
On this page

Timeout Plugin

Timeout Plugin automatically aborts requests that exceed a given timeout with an AbortError.

Usage

import { TimeoutLinkPlugin } from '@orpc/client/plugins'

const link = new RPCLink({
  plugins: [
    new TimeoutLinkPlugin({
      timeout: 10_000, // 10 seconds
    }),
  ],
})

Dynamic Timeout

The timeout option also accepts a function, so you can resolve the timeout per request from the interceptor options, such as the procedure path or the client context:

const link = new RPCLink({
  plugins: [
    new TimeoutLinkPlugin({
      timeout: ({ context, path }) => context.timeout ?? 10_000,
    }),
  ],
})

Learn More

For implementation details, see the source code.

Last updated on August 6, 2026

Was this page helpful?