Engineering

One Form, Three Channels: How the type Field Works

cover image — one form fanning into a page, a widget, and an API

cover image — one form fanning into a page, a widget, and an API

A campaign form starts life as a hosted page. Three weeks later it needs to live inside the product as a widget, and a backend job needs to post to it too. In Forms Expert, that progression isn't three builds — it's one definition, three surfaces, selected per form by a single field.

The Type Field

Every form carries a type that decides how it ships. It takes one of four values:

  • hosted — a standalone page at /h/{slug}.
  • embed — an auto-resizing widget at /e/{slug}.
  • api — an API-only form, with no hosted or embed UI.
  • both — a hosted page and an embeddable widget from the same definition.

Because the surface is a property of the form rather than a separate build, changing how a form ships is a one-field edit that leaves the form's logic untouched.

The Fourth Surface: a Universal REST Endpoint

There is a fourth surface that is not a type value at all. Every published form also accepts programmatic submissions at a REST endpoint, authenticated with a publishable key:

POST /f/{resourceId}/{slug}?token=pk_live_…
Content-Type: application/json
{ "email": "priya@acme.com", "score": 9 }

So a both form is, at the same time, a hosted page, an embeddable widget, and a REST endpoint. The type field selects which UI surfaces are provisioned; the submission endpoint is always there.

Key Insight: A form's logic — its fields, validation, conditional branches, and consent — lives in exactly one place. The type field decides where the form appears, not what it contains, so there is never a second copy to keep in sync when a campaign moves from a landing page to an in-app embed.

Why It Matters

The practical payoff is that a marketer can embed the form on a campaign site while a developer posts to the same form from a backend job — both hit the same endpoint, and neither keeps a separate copy. For embedding, the recommended path is the published SDK, @forms.expert/sdk (npm install @forms.expert/sdk, or load it from https://unpkg.com/@forms.expert/sdk). It ships React (@forms.expert/sdk/react), Vue, and vanilla-JS bindings, renders the form inline rather than in an iframe, and exposes theme, language, and submission callbacks (onSuccess/onError). If you'd rather avoid a dependency, the raw widget at /e/{slug} reports submissions through postMessage and auto-resizes with its content, and the REST endpoint lets a backend call the form directly with fetch.

Delivery Is Built In

Once a submission lands, Forms Expert routes it to the destinations you configure — email, Telegram, and signed webhooks that retry up to five times with exponential backoff. On the Pro plan and up, a completion funnel shows where people drop off, alongside per-field stats and NPS. None of this requires exporting data or wiring a separate analytics tool.

Wrapping Up

The type field is small, but it carries the whole promise: it is the reason a form can move from a landing page to an in-app embed to a backend integration without anyone rebuilding it. If flat pricing and triple delivery matter more to you than a conversational survey UX, the Typeform alternative comparison goes deeper.

Frequently Asked Questions

The type field is a single property on every form that decides how that form is delivered. It takes one of four values: hosted (a standalone page at /h/{slug}), embed (an auto-resizing widget at /e/{slug}), api (an API-only form with no public UI), or both (a hosted page and an embeddable widget from the same definition). Because delivery is a property of the form rather than a separate build, switching surfaces is a one-field edit instead of a rebuild. The same field schema, validation, conditional logic, and consent settings apply no matter which surface a respondent uses.

Continue reading

How to Write Good Survey Questions (40+ Examples and Rules)Guides
July 14, 2026

How to Write Good Survey Questions (40+ Examples and Rules)

The 5 rules behind a good survey question, a bank of 40+ copy-ready examples by use case, and the leading and double-barrelled questions to avoid.

Read article →
Types of Survey Questions: 12 Formats and When to Use EachGuides
July 7, 2026

Types of Survey Questions: 12 Formats and When to Use Each

A labeled catalogue of 12 survey question types, from multiple choice and Likert to ranking and open-ended, each with an example and when to use it.

Read article →
How to Build a Multilingual Form (Methods, Pitfalls, and Examples)Guides
June 30, 2026

How to Build a Multilingual Form (Methods, Pitfalls, and Examples)

One form, several published languages, a switcher respondents control. Here are the four ways to build a multilingual form, the DIY Google Forms route, and the UTF-8, RTL, and locale pitfalls that quietly break translations.

Read article →

Get New Posts by Email

Occasional, practical notes on shipping forms everywhere — no spam.

rendered with @forms.expert/sdk

Try the Form Delivery Engine

Build a form once and ship it three ways — start on the Free plan, no credit card required.