Today Canvas Kit
SDK packages

@todayai-labs/tck-preview

react-email-style dev shell for widgets. Boots Vite, auto-discovers widgets, renders them with theme/size/state controls.

A dev-only preview shell, modelled on react-email. Auto-discovers widgets in widgets/*/widget.tck.tsx, mounts each in a real TodayHost, and gives you theme + size + state controls without writing any host wiring yourself.

tck-preview is what pnpm dev invokes inside a scaffold produced by create-widget. The preview-side iframe runs each widget against the same WidgetLoader + import-map machinery production hosts use — tck-preview is not a sandbox toy, it's the production contract running locally.

CLI

# Boot the preview shell on the current directory
pnpm exec tck-preview

# Or programmatically
import { startPreview } from '@todayai-labs/tck-preview'
const handle = await startPreview({ root: process.cwd() })

Programmatic surface

ExportWhat it does
startPreview(options): Promise<PreviewHandle>Boot the Vite server + preview shell. Returns a handle with close() and the resolved URL.
defineConfig(config)Type-safe config helper for tck-preview.config.ts.
PreviewHandle, PreviewOptions, PreviewConfigTypes for the boot API.

Source

On this page