screenshot
Install the required plugin:
tynd add screenshotimport { screenshot } from "@tynd/plugin-screenshot/client";Backed by xcap, which wraps the platform-native capture APIs:
- macOS —
CGDisplayCreateImage/CGWindowListCreateImage - Windows — DXGI desktop duplication /
BitBltfallback - Linux — X11
XGetImageor PipeWire (Wayland)
Captures arrive as PNG bytes wrapped with the captured dimensions; data is base64 so the response drops straight into a data:image/png;base64,… URL.
API surface
Section titled “API surface”screenshot.captureScreen(monitorIndex?): Promise<CapturedImage>— capture a monitor (defaults to index0).screenshot.captureWindow(windowId): Promise<CapturedImage>— capture a single window.screenshot.listMonitors(): Promise<MonitorInfo[]>— enumerate connected monitors.screenshot.listWindows(): Promise<WindowInfo[]>— enumerate visible top-level windows.
captureScreen and captureWindow are gated by the native screenshot:capture* ACL; listMonitors and listWindows are left ungated so settings UIs can populate pickers before the user has granted capture rights.