Source location

Open an original document beside an answer and reveal the authored source region.

Use one target model

ts
await viewer.reveal({
  kind: 'source',
  unitIndex: 6,
  objectId: 'paragraph-42',
  region: { x: 96, y: 412, width: 510, height: 88 }
});

A target may resolve to a page, slide, worksheet, object, or bounded region. When exact object mapping is unavailable, the Viewer uses the most reliable page-level fallback and emits a diagnostic.

Integration with AI products

The host product owns retrieval, answer generation, permissions, citation choice, and business workflow. DocViewKit owns document presentation and navigation to a source reference.

Keep facts deterministic

Pass the citation target produced by your retrieval pipeline. Do not ask the Viewer to infer which passage an answer used.