Add a Contact Form to Your Replit App

Embed the Helpdesky Contact Form on your Replit site or web app in minutes. Includes a copy paste prompt for the AI builder.

Adding a Contact Form to your Replit app gives visitors a clean way to send you a message without you wiring up email, SMTP, or a backend. The form drops in as a single script tag and submissions appear in your Helpdesky inbox.

This guide assumes you are vibe coding a public site or web app on Replit. The Contact Form is for anonymous visitors, so no HMAC or login is required. If you need a portal for signed in users instead, see Add a Ticket Center to Your Replit App.

Set Up Your Contact Form

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 on this page, 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

In your Replit project, paste the snippet into the page where you want the form. For a plain HTML site, paste it inside the <body> of index.html. For a React or Vite app, place the container div in the page component and load the script in a useEffect or via <Helmet>. For a Next.js app, use the <Script> component.

The form renders itself inside the container div, handles validation and submission, and shows its own success state. Reload the page in Replit's webview and the form appears.

Copy This Prompt for Your AI Builder

If you are building with Replit's AI agent, paste the prompt below into the chat. It tells the agent exactly what to do, where to put the embed, and where to read the canonical instructions.

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.
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 same document the Helpdesky AI agent skill installs, so the agent follows the real embed format instead of guessing. If Replit Agent is connected to the Helpdesky MCP server it also does the dashboard part for you: it enables messaging, adds your app's 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 in the dashboard yourself.

Test It

Open your Replit app's preview, fill out the form with a real email, and submit. Within a few seconds the new conversation should appear in your Helpdesky Messages inbox. Reply from the dashboard and your response will be emailed back to the address you submitted with.

If submission fails:

  • Check the browser console for blocked script errors. Replit's preview occasionally caches old script tags. A hard reload usually fixes it.

  • Confirm data-helpdesk-id matches the value shown in your dashboard.

  • If you front your Replit app with Cloudflare and want bot protection, follow the Cloudflare Turnstile Setup Guide.

Next Steps

Once the form is live, route inbound support emails into the same helpdesk by following the Email Forwarding Setup Guide. When you ship a logged in dashboard inside your Replit app, swap the public form for a Ticket Center so signed in users can see their full conversation history.

Let an AI Agent Answer the Form

Once messages start coming in, you can hand the first reply to an AI agent. Go to Inbox → AI Agents (beta) in the dashboard, create an agent, and pick a Mode. Review means the agent drafts a reply and waits for your one click approval in the inbox. Autopilot means it sends on its own within the pacing and guardrails you set.

Then open Behaviour → Channels and switch on Contact form. The agent now picks up conversations from your Replit app, and the visitor gets the reply by email just like a reply you typed.

The agent runs on your own AI provider key, which goes in Settings → AI Settings, so add that first. See Set Up Your First AI Agent for the walkthrough and the guardrails and pacing guide for reply delays, daily caps and hand off rules.

Cool Features

The contact form features some cool features that you can do.

  1. Remove the border easily: this allows you to place the contact form without a background or border into any section so it instantly looks integrated into your site's/app's branding. Just go to the Contact Form page, go to "Layout" section and you will see an option for "Hide outer border". This will hide the border and background.
  1. Integrate Cloudflare Turnstile to protect your form from spammers. This requires you to host your domain in Cloudflare. All you need to do is go to your Cloudflare account, go to Turnstile, add your domain, create the keys, and copy them to Helpdesky Contact Form settings page.
  1. Lock the form to your own domains: anyone can read your Helpdesk ID in the page source and paste it into another site. Go to Settings → Messages → Allowed Embed Domains and add your Replit app's domain (and your custom domain if you have one). Subdomains are included automatically, and an empty list allows every domain. More in Restrict Embeds to Specific Domains.

  2. Make it look and read like your app: on the Contact Form page you can add Custom Fields (Text, Text Area, Dropdown, Checkbox, Number), which show up between Email and Message and can be required. You can rename every label, placeholder, the button text and the success message, so the form can be in your language. The Appearance section has Accent Style, Use Branding Background and colour pickers, and the Custom CSS section has a View example snippets library with ready made styles (Brand Colors, Dark Mode / Dark Background, Rounded / Pill Style, Flat / Minimal, Custom Fonts, Full-Width Bold Button, Compact Form). The Contact Form Setup Guide has the full list.

Last updated on October 13, 2026