Your first app
We’ll build an app for a window fitter: it asks which brand they install and tells the assistant to write it on every line of the quote.
1. Install the SDK
Section titled “1. Install the SDK”npm install @prezzando/plugin-sdkThe package carries the contract, the validator and a CLI. It has no dependency on Prezzando itself: an app is an ordinary module.
2. Declare the manifest
Section titled “2. Declare the manifest”import { definePlugin, PLUGIN_API_VERSION } from "@prezzando/plugin-sdk";
export default definePlugin({ id: "windows", apiVersion: PLUGIN_API_VERSION, version: "1.0.0", name: "Windows and doors", summary: "From the survey to the quote, with your own price list.", icon: "hammer", settings: [ { key: "brand", type: "text", label: "Brand you install", help: "Written next to each item, so the client knows what they're buying.", maxLength: 60, }, ], prompt: (ctx) => { const brand = typeof ctx.settings.brand === "string" ? ctx.settings.brand : ""; if (!brand) return null; return `### Windows and doors\n\nThis company fits ${brand}. Name the series in the detail of every item.`; },});Three things are worth naming.
definePlugin validates the shape when the module loads, not when a
customer first uses the app: a malformed manifest stops the host from starting,
which is where a programming error belongs.
settings are descriptors, not a form. The host draws the panel from them and
validates the saved values against them, on the server too — a modified client
can’t write a value outside the declared options.
prompt receives the settings and returns text, or null when there’s nothing
to say. It runs on every request, so it must be synchronous and cheap: no
network, no database.
3. Look at it
Section titled “3. Look at it”npx prezzando-preview windows.tsThe storefront card, the settings panel and the resulting prompt, in the browser, reloading every time you save the file. See Seeing it before shipping.
4. Check it without a host
Section titled “4. Check it without a host”npx prezzando-plugin validate windows.tsnpx prezzando-plugin panel windows.ts --settings '{"brand":"Schüco"}'npx prezzando-plugin prompt windows.ts --settings '{"brand":"Schüco"}'The CLI loads the manifest, applies the settings and prints what the panel and the model would get. It’s the fastest way to catch a prompt that says nothing because a setting was left empty.
Where to go next
Section titled “Where to go next”- Settings, declared — every field type, and when to use which.
- Illustrating a setting — show what an option does instead of explaining it.
- Tools, jobs and the prompt — when your app has to compute, not just instruct.