Skip to main content
Every block has a chatblocks.json manifest at the root of its file set. The manifest is the contract between your code and the platform: it declares the format, the canvas footprint, what data flows in, and what the iframe is allowed to do. The full Zod schema lives in packages/shared/src/manifest.ts. This page covers the shape; the schema there is the source of truth and what the server validates against.

Minimal manifest

A barebones code block with no widget or data binding:
That’s all that’s required. Everything else has sensible defaults.

Top-level fields

Formats

Chatblocks has two first-class formats. The bar for adding a new one is a platform invariant the AI generator can’t be trusted to uphold on its own — everything else stays code.
Vibe-coded block. Your file set is built into an iframe-loaded artifact via Vercel Sandbox. Strict CSP, no cross-origin framing, sandboxed iframe.Required: entry must be a relative path to a file in your set. Conventional: src/App.tsx.

Permissions

Declare the capabilities your code block needs. Each is opt-in. The network permission and network.allowedOrigins are coupled — declaring one without the other is a validation error. Origins must be HTTPS, origin-only (no path/query/hash/credentials, no wildcards).

Binding

Optional. Connects the block to a configured data source so the platform refreshes its widget data on a cron (or push) cadence.
The queryConfig.type is one of KNOWN_QUERY_TYPES (see packages/shared/src/binding.ts):
  • stripe.mrr, stripe.balance, stripe.recentCharges
  • postgres.sql
  • webhook.latest, webhook.aggregate, webhook.list
  • mcp.tool
The projection maps raw query output into the widget’s data shape. Each field is either { source, format?, formatOptions? } (pluck from the query result with optional formatting) or { literal } (constant value). Formats: currency, number, percent, percent-with-sign, datetime. Cross-reference: the Connecting data section walks through each connector and the queries it supports.

Constraints reference

constraints.min* and constraints.max* set the block’s resize bounds on a canvas. Defaults are derived from defaultSize:
  • min* = defaultSize.* × 0.6, clamped to ≥ 50.
  • max* = defaultSize.* × 2.5, clamped to ≤ 2000.
Override explicitly when your block has a tighter aesthetic range:
The validator enforces min ≤ max for each axis, and defaultSize must lie within [min, max].

Validation errors

When validation fails, the API returns a list of issues, each with a stable code:

What’s next

Widget

The iOS widget projection — six templates, five themes, sample-data schema.

Runtime

What happens at render time — render paths, sandbox, data injection.