Use case · Form replacement
Script-tag signup forms
Replace a long signup form with a conversational AI agent in 10 seconds. Drop the script tag, mark up your form with data-dornick, and the agent fills the inputs as the user types.
@dornick/scriptPageMountDataPointsonComplete
Try it live → Run the signup-form demo with your own API key.
The shape
You have a long signup form. Users bounce. You want to replace it with a friendly chat that asks one question at a time, validates as it goes, and posts the collected data to your existing endpoint.
Dornick’s script-tag mode does exactly that, in 10 seconds.
Markup
<script src="https://unpkg.com/@dornick/script/dist/dornick.js"></script>
<form
id="signup"
data-dornick
data-dornick-config="/configs/signup.json"
data-dornick-provider="anthropic"
data-dornick-model="claude-sonnet-4-6"
data-dornick-proxy="/api/dornick"
action="/api/save"
method="POST"
>
<input name="email" required />
<input name="company" />
<input name="role" />
<input name="team_size" type="number" />
<input name="goal" />
<button type="submit">Submit</button>
</form>
That’s it. Dornick hides the form, mounts a Shadow-DOM chat overlay, and asks the user one question at a time. When all fields are collected, it un-hides the form (or auto-submits, your call).
Config
{
"persona": "Friendly onboarding assistant. One question at a time. Warm, brief, never robotic.",
"target": { "type": "form", "selector": "#signup" },
"dataPoints": [
{ "name": "email", "question": "What's your work email?", "validate": "email" },
{ "name": "company", "question": "Which company are you with?" },
{ "name": "role", "question": "What's your role there?" },
{ "name": "team_size", "question": "Roughly how big is your team?", "validate": "number" },
{ "name": "goal", "question": "What are you trying to do with us?" }
],
"completion": { "type": "submit-form" }
}
What this gets you
- One question at a time. No 12-field wall of inputs.
- Real validation. Dornick’s
beforeFieldFillhook can veto or transform. - Existing handlers run. Your form’s
submitlistener fires normally on completion. - No backend changes. Your
/api/saveendpoint sees the same shape as if a human typed. - Streaming UX. Token-by-token response, native
ReadableStream.
Why not just use a chatbot widget?
A widget would ask the same questions but throw away the answers when the user
closes the tab. Dornick writes to your real <input> fields, so your form’s
existing validation, React state, browser autofill, and Save-the-form-state
behavior all work normally. The agent is operating on the form — not replacing it.
What it costs
Per session: ~5–10 LLM round trips × ~500 input tokens × Sonnet 4.6 ($3/M input). $0.0075 to $0.015 per completed signup, including prompt caching savings. Way cheaper than the human time saved.
FAQ
Will it fight my existing form validation?
No. Dornick dispatches real input events on your <input>s, so your client-side validation, React state, and existing handlers run exactly as if the user had typed.
What if I don't want a chat UI?
You can hide it. Use the headless mode and drive the agent loop without rendering chat — Dornick will still fill the fields.
Ship an agent-driven flow this afternoon.
Install Dornick, paste a config, and your form turns into an agent that fills its own inputs.