FormMaker docs
Guides

Use the generated code

Drop a rebuilt form into your site and have submissions land in HubSpot.

When you'd rather own the form as code than ship a HubSpot embed, use generate_form. This guide covers what you get back and how to put it to work.

What the rebuild returns

generate_form does not write the code. It returns a Generation Brief — the fields, the submission contract, your framework's conventions, and an acceptance checklist. Your own AI client writes the component from that brief.

The split is deliberate: the brief is deterministic, and the model does the part models are good at. Nothing about your portal is sent to a model FormMaker runs.

Rebuild my "Website contact" form as a React component. Use my brand from example.com.

Dropping it in

Paste the generated component into your site like any other component. It posts submissions straight back to your portal using the submission contract carried in the brief — you don't wire up an endpoint by hand.

The component uses your publishable key (fm_pub_), which is safe to ship in public code. Your private fm_live_ key never goes near it.

Verifying submissions land

Do one real submission, then check HubSpot:

  • the contact record for the details you entered, and
  • any workflow or form-submission trigger you expect it to fire.

If it shows up there, the form is wired correctly.

See also

  • generate_form — the full tool reference.
  • Add variables — what a form can and can't carry (prefill, hidden fields, UTM/source).