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-linda, and the agent fills the inputs as the user types.

  • @linda/script
  • PageMount
  • DataPoints
  • onComplete

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.

Linda’s script-tag mode does exactly that, in 10 seconds.

Markup

<script src="https://unpkg.com/@linda/script/dist/linda.js"></script>

<form
  id="signup"
  data-linda
  data-linda-config="/configs/signup.json"
  data-linda-provider="anthropic"
  data-linda-model="claude-sonnet-4-6"
  data-linda-proxy="/api/linda"
  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. Linda 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. Linda’s beforeFieldFill hook can veto or transform.
  • Existing handlers run. Your form’s submit listener fires normally on completion.
  • No backend changes. Your /api/save endpoint 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. Linda 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. Linda 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 — Linda will still fill the fields.

Ship an agent-driven flow this afternoon.

Install Linda, paste a config, and your form turns into an agent that fills its own inputs.