Read the local dashboard guide. Signatures below come from the published SDK declarations. Access SDK services through db; use their constructors only when integrating at a lower level.
DashboardSnapshot
interface DashboardSnapshot {
namespace: string;
generatedAt: number;
tables: {
name: string;
private: boolean;
count: number;
authors: string[];
rows: Row<object>[];
}[];
relays: {
url: string;
connected: boolean;
authenticated: boolean;
pendingRequests: number;
}[];
logs: DiagnosticEntry[];
pendingWrites: {
eventId: string;
pubkey: string;
kind: number;
}[];
}
NostrbaseDashboard
/** Read-only local inspector. Private plaintext is never decrypted or displayed. */
declare class NostrbaseDashboard {}
constructor
constructor(host: DashboardHost);
snapshot
snapshot(): Promise<DashboardSnapshot>;
render
render(): Promise<string>;
mount
mount(
element: HTMLElement,
options?: {
interval?: number;
onError?: (error: NostrbaseError) => void;
},
): {
refresh(): Promise<void>;
destroy(): void;
};
Supporting declarations
These types appear in public signatures but are not package exports.
DashboardHost
interface DashboardHost {
namespace: string;
relays: string[];
pool: RelayPool;
eventStore: EventStore;
diagnostics: NostrbaseDiagnostics;
offline: {
list(): Promise<
{
event: {
id: string;
pubkey: string;
kind: number;
};
}[]
>;
};
definition<T extends object>(table: string): TableDefinition<T> | undefined;
isDeleted(event: Parameters<EventStore["add"]>[0]): boolean;
ready(): Promise<void>;
assertOpen(): void;
trackEventSubscription(dispose: () => void): () => void;
}