How to Add a Contact Form to Bolt.new

Embed the Helpdesky Contact Form in your Bolt.new app with one paste. Includes a ready to paste AI builder prompt.

Adding a Contact Form to Bolt.new lets your visitors message you without setting up SMTP, email, or a backend. The Helpdesky Contact Form drops in as one container div and one script tag, handles its own validation, and lands every submission in your Helpdesky inbox where you can reply by email.

This guide is for anonymous visitors. There is no login, no HMAC, no backend wiring. If you need a portal for signed in users instead, see the Ticket Center Setup Guide.

Why this is the easy contact form for a Bolt project: the Free plan covers the first 15 conversations every month, you do not need SMTP or a separate form provider, and the embed is one snippet that drops into the contact page Bolt scaffolds for you. Replies from your Helpdesky inbox go to the visitor's email automatically.

Set Up Your Helpdesk

Open the Helpdesky dashboard and go to Contact Form in the sidebar. Copy the embed snippet at the top of the page. It already has your Helpdesk ID filled in:

<div id="hdh-contact-form"></div>
<script src="https://helpdesky.io/contact-form.js"
  data-helpdesk-id="YOUR_HELPDESK_ID"></script>

While you are there, also enable messaging from the Messages sidebar item if you have not already. The toggle is at the top of the Messages page.

Add the Embed Code

Bolt.new typically scaffolds a Vite + React project. Open the contact page component (often src/pages/Contact.tsx or src/App.tsx) and add the container div in your JSX, then load the script.

The simplest pattern is to inject the script once when the component mounts:

import { useEffect } from "react";

export default function Contact() {
  useEffect(() => {
    const s = document.createElement("script");
    s.src = "https://helpdesky.io/contact-form.js";
    s.setAttribute("data-helpdesk-id", "YOUR_HELPDESK_ID");
    document.body.appendChild(s);
    return () => { s.remove(); };
  }, []);

  return <div id="hdh-contact-form" />;
}

If Bolt is generating plain HTML output, you can paste the snippet directly into index.html inside the <body>.

Copy This Prompt for Your AI Builder

Paste the prompt below into the chat. It tells the agent exactly what to add and where to read the canonical instructions, so the agent fetches the real embed format instead of guessing.

we need to add the helpdesky contact form to the public site.
read the contact form section of the helpdesky skill file first: https://helpdesky.io/docs/skill.md
if you can use mcp, connect to https://helpdesky.io/mcp before you touch any code and enable the setup tool set if the embed tools are not listed. use it to enable messaging, add this site's domain to allowed embed domains, and fetch the contact form snippet with the helpdesk id already filled in.
if you cannot use mcp, ask me for the helpdesk id from the contact form page in the dashboard and i will enable messaging and add the domain myself.
the project is a vite + react app generated by bolt.new. add a /contact route with the embed inside a useEffect that injects the script tag once.
then drop the embed snippet into the contact page.
the form does not need any secret env vars since it is for anonymous visitors.
when you are done, confirm the form renders and submits successfully.

The skill file is the document the Helpdesky AI agent skill installs, so Bolt reads the real embed format instead of guessing. With MCP connected it also takes care of the dashboard: it enables messaging, adds your domain to Allowed Embed Domains and pulls the snippet with your Helpdesk ID already filled in. Without MCP it asks you for the ID and you flip those two settings yourself.

Test It

Open Bolt's preview, fill in the form, and submit. The new conversation should appear in your Helpdesky Messages inbox within seconds. If nothing appears, check the browser console: a stale Vite HMR cache or a duplicated script tag is the usual culprit. A hard reload clears it.

Next Steps

Route inbound support email into the same helpdesk by following the Email Forwarding Setup Guide. If you start getting bot submissions, layer on bot protection with the Cloudflare Turnstile Setup Guide. When you ship a signed in dashboard, swap the public form for a Ticket Center so users can see their full conversation history.

Let an AI Agent Reply for You

Bolt scaffolds the page; a Helpdesky AI agent can handle the replies. Create one under Inbox → AI Agents (beta) and choose a Mode. Review drafts the answer and waits for one click approval in the inbox; Autopilot sends on its own within the pacing and guardrails you set.

In Behaviour → Channels, switch on Contact form so conversations that start in your Bolt app reach the agent. The visitor gets the reply by email, no different from one you send yourself.

Agents need your own AI provider key in Settings → AI Settings before anything runs. Set Up Your First AI Agent covers creation and testing, and the guardrails and pacing guide covers reply delays, daily caps and hand off.

Cool Features

A couple of small things you can turn on once the basic form is live.

  1. Hide outer border: drop the form into any section without a background or border so it blends straight into your branding. From the Contact Form page, open the Layout section and toggle Hide outer border.
  1. Cloudflare Turnstile spam protection: if your domain is on Cloudflare, you can protect the form from bots in a few clicks. Open your Cloudflare account, go to Turnstile, add your domain, generate the keys, and paste them into the Helpdesky Contact Form settings. Full walkthrough in the Cloudflare Turnstile Setup Guide.
  1. Allowed Embed Domains: keep other sites from loading the form with your Helpdesk ID. Under Settings → Messages → Allowed Embed Domains, add the domain you deploy the Bolt app to; subdomains are included automatically, and an empty list allows every domain. Details in Restrict Embeds to Specific Domains.

  2. Make the form yours: add Custom Fields of type Text, Text Area, Dropdown, Checkbox or Number; they render between Email and Message and can be marked required. Labels, placeholders, the button text and the success text are all editable, so the form can be in your app's language. Accent Style paints the button with your Branding colours, Use Branding Background and the colour pickers cover the rest, and the Custom CSS section has a View example snippets library (Brand Colors, Dark Mode / Dark Background, Rounded / Pill Style, Flat / Minimal, Custom Fonts, Full-Width Bold Button, Compact Form). See the Contact Form Setup Guide for the full list.

Last updated on October 13, 2026