Skip to content

Mode A: Frontend-Only

Mode A is the primary, zero-config operating mode for applications with an embedded multimodal AI copilot.

  1. User triggers the overlay (via Alt+shake, shortcut, button, or touch).
  2. User drags to select a region (or presses Enter for full viewport).
  3. The selected region is captured with SnapDOM and delivered as a PNG Blob to your onResult callback.
  4. No backend route or API keys are required.
User Snip ───► SnapDOM Canvas ───► PNG Blob ───► truden.onResult(blob) ───► AI Chat Attachment
import { useEffect, useState } from "react";
import truden from "truden";
export function AIAssistant() {
const [image, setImage] = useState<Blob | null>(null);
useEffect(() => {
return truden.init({
onResult: (blob: Blob) => setImage(blob),
});
}, []);
return <ChatWidget attachment={image} />;
}