nostrbasedocs
Start building
API reference
.md

Read the diagnostics guide. Signatures below come from the published SDK declarations. Access SDK services through db; use their constructors only when integrating at a lower level.

DiagnosticType

type DiagnosticType =
  "request" | "publish" | "ingest" | "error" | "connection" | "sync" | "queue";

DiagnosticEntry

interface DiagnosticEntry {
  sequence: number;
  timestamp: number;
  type: DiagnosticType;
  operation: string;
  details: Readonly<Record<string, string | number | boolean | null>>;
}

DiagnosticsOptions

interface DiagnosticsOptions {
  enabled?: boolean;
  capacity?: number;
  onEntry?: (entry: DiagnosticEntry) => void;
}

NostrbaseDiagnostics

/** Content, keys, signer objects, headers, and payloads are never included in SDK diagnostics. */
declare class NostrbaseDiagnostics {}

Properties

readonly events$: Observable<DiagnosticEntry>;

constructor

constructor(options?: DiagnosticsOptions);

record

record(
  type: DiagnosticType,
  operation: string,
  details?: Record<string, string | number | boolean | null>,
): void;

list

list(): DiagnosticEntry[];

clear

clear(): void;

close

close(): void;

Search guides, API methods, and protocols.