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

GDPR Cookie Consent: What's Required and How to Do It RightCompliance
September 22, 2026

GDPR Cookie Consent: What's Required and How to Do It Right

What the GDPR and ePrivacy require for cookie consent, which cookies need it, blocking scripts before consent, and how to implement it right.

Read article →
GDPR Cookie Consent, Built Into the FormCompliance
September 15, 2026

GDPR Cookie Consent, Built Into the Form

Forms Expert ships a GDPR cookie consent module inside the form platform: configurable modals, category-level choices, stored consent records, per-modal analytics, and Google Consent Mode. No second consent vendor to bolt on.

Read article →
How to Build GDPR-Compliant Forms (Requirements and Examples)Compliance
September 8, 2026

How to Build GDPR-Compliant Forms (Requirements and Examples)

What the GDPR requires of a form, the 7 elements of a compliant one, good vs bad consent wording, and how to build it without overclaiming.

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.