@stacktrace-lite/core
    Preparing search index...

    Type Alias BrowserHookOptions

    Use these hooks to normalize, filter, and format browser-side error stacks. When an error or unhandled promise rejection occurs, the stack is parsed into StackFrame objects, optionally filtered and formatted, and then surfaced via BrowserHookOptions.onStack or logged by default.

    type BrowserHookOptions = {
        filter?: Parameters<typeof filterStack>[1];
        format?: Parameters<typeof formatStack>[1];
        onStack?: (
            frames: StackFrame[],
            error: Error | Event | PromiseRejectionEvent,
        ) => void;
    }
    Index

    Properties

    filter?: Parameters<typeof filterStack>[1]

    Filter configuration passed to filterStack.

    Accepts the same options as filterStack, such as include, exclude, and preset (e.g., 'app-only' to drop node_modules and internals).

    format?: Parameters<typeof formatStack>[1]

    Format configuration passed to formatStack.

    Select an output mode appropriate for your destination (e.g., 'cli' for console/devtools or 'html' for UI rendering).

    onStack?: (
        frames: StackFrame[],
        error: Error | Event | PromiseRejectionEvent,
    ) => void

    Callback invoked with the processed frames and the original event payload.

    Type declaration

      • (frames: StackFrame[], error: Error | Event | PromiseRejectionEvent): void
      • Parameters

        • frames: StackFrame[]

          The parsed and (optionally) filtered stack frames.

        • error: Error | Event | PromiseRejectionEvent

          The originating object: an Error, an ErrorEvent from window.addEventListener('error', ...), or a PromiseRejectionEvent from window.addEventListener('unhandledrejection', ...).

        Returns void

    Use this to send telemetry, display a toast, or open an error overlay. If omitted, a nicely formatted stack is logged to the console.