AgentStack Docs

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. Each key is a form name. Each value is an asynchronous callback that returns a schema.

Registration replaces the previous map of forms. Each call must pass the complete registry of forms. Do not add one entry at a time.

The schema contains fields and optional text for submission, success, and error states. Supported field types are text, email, tel, number, URL, textarea, select, radio, checkbox, and date.

A field name cannot be empty. A field name cannot contain ., [, or ]. Radio and checkbox fields need options. The options cannot be empty.

Callback execution has a five-second limit. Forms work in the live embedded site. In Playground and Compare, they show a fixed preview instead.

The callback receives AI context and decoded JWT claims. Use these only for prefill or display. Do not use them for authorization.

A successful submission emits form:submitted to the host. It can also send a form.submitted webhook. To trigger trusted backend work, use the verified webhook signal. Also verify delivery independently.