@samveys/inspector

Records requests, queries, jobs, mail and exceptions in development

Version
1.0.3Nov 5, 2026
Install
pnpm add @samveys/inspector

This list was read from version 1.0.2; run pnpm sync to refresh it.

Import
import { createInspector, inspector } from '@samveys/inspector'

Function (2)

createInspector Function

The `'inspector'` binding: `record()` lets other packages add entries (mail, jobs).

function createInspector(limit?: number): {

Exported from packages/inspector/src/inspector.ts

inspector Function

Development inspector. Outside `local`, `/_inspector` is a 404 unless `gate` allows.

function inspector(options?: InspectorOptions): import("@samveys/core").Plugin<InspectorOptions>;

Exported from packages/inspector/src/inspector.ts

Interface (2)

InspectorEntry Interface

No documentation comment.

interface InspectorEntry {
    readonly id: string;
    readonly type: EntryType;
    readonly at: number;
    /** Request id of the request that produced it, when there is one. */
    readonly requestId: string | undefined;
    readonly data: Readonly<Record<string, unknown>>;
}

Exported from packages/inspector/src/inspector.ts

InspectorOptions Interface

No documentation comment.

interface InspectorOptions {
    /** Entries kept in memory (ring buffer). Default 1000. */
    readonly limit?: number;
    /** Default `/_inspector`. */
    readonly path?: string;
    /** Outside `local` the dashboard answers only when this returns true; otherwise 404. */
    readonly gate?: (ctx: HttpContext) => boolean | Promise<boolean>;

Exported from packages/inspector/src/inspector.ts

Type (2)

EntryType Type

No documentation comment.

type EntryType = 'request' | 'query' | 'exception' | 'job' | 'mail' | 'log' | (string & {});

Exported from packages/inspector/src/inspector.ts

Inspector Type

No documentation comment.

type Inspector = ReturnType<typeof createInspector>;

Exported from packages/inspector/src/inspector.ts