Skip to content

Core SDK API

WaspadaSDK

The main SDK class. Create one instance per app session.

Constructor

typescript
new WaspadaSDK(config: WaspadaSdkConfig)

Methods

initAndCache(): Promise<InitStatus>

Initialize the SDK, download models, and set up storage.

typescript
interface InitStatus {
  ready: boolean;
  storage_backend: 'OPFS' | 'IndexedDB';
  ocr_languages_cached: string[];
  ner_model_cached: boolean;
  warnings: string[];
}

processEvidence(file: File): Promise<ExtractionResult>

Process an evidence file through the extraction pipeline.

typescript
interface ExtractionResult {
  success: boolean;
  indicators: ExtractedIndicators;
  extraction_tier: 'REGEX_ONLY' | 'NER_ENCODER' | 'HYBRID';
  confidence: number;
  document_type: 'PDF' | 'IMAGE';
  warnings: string[];
  raw_text_length: number;
}

submitTelemetry(result: ExtractionResult): Promise<void>

Submit PII-stripped telemetry to the Waspada Gateway.

terminate(): void

Release all resources (workers, model memory, storage handles).

Properties

PropertyTypeDescription
versionstringSDK semantic version

Waspada AI: Enterprise infrastructure powering public defense.