Client-side forms
Register supported widget forms and handle verified webhook delivery.
Configure a custom_form action with an exact form name and use case, then register its schema in the host page with window.agentstack.registerFormSchema. The registration takes a map from form name to an asynchronous callback that returns a schema. Registration replaces the prior forms map, so pass the complete desired registry every time rather than incrementally adding one entry.
The schema contains fields plus optional submission and success or error text. Supported field types are text, email, telephone, number, URL, textarea, select, radio, checkbox, and date. Field names cannot be empty or contain ., [ or ]; radio and checkbox fields need nonempty options. Callback execution has a five-second limit. Forms work in the live embedded site, while Playground and Compare show a fixed preview.
The callback receives AI context and decoded JWT claims that are suitable only for prefill or display, not authorization. A successful submission emits form:submitted to the host and can send a form.submitted webhook. Use the webhook's verified signal and independently verified delivery to trigger trusted backend work.