OptionalafterHooks that run after a successful HTTP response. Each hook receives the response from the previous hook and the return value is passed to the next hook (or returned to the caller).
OptionalbeforeHooks that run before each HTTP request. Each hook receives a copy of the request options and the return value is passed to the next hook (or used for the request).
OptionalonHooks that run when an API error is detected. Each hook receives the error and the full HTTP response. If all hooks return without throwing, the error is suppressed.
OptionalonHooks that run when a network or rate-limiting error occurs. If all hooks return without throwing, the error is suppressed.
Hooks for customizing the PolarityRequest lifecycle. All hook arrays execute in order.
beforeRequestandafterResponsehooks chain their output, while error hooks run sequentially and can suppress errors by returning without throwing.