interface BeforeRequestHook {
    beforeRequest: (
        hookCtx: HookContext,
        request: Request,
    ) => Awaitable<Request>;
}

Implemented by

Properties

Properties

beforeRequest: (hookCtx: HookContext, request: Request) => Awaitable<Request>

A hook that is called before the SDK sends a request. The hook can introduce instrumentation code such as logging, tracing and metrics or replace the request before it is sent or throw an error to stop the request from being sent.