How to Add a Contact Form to v0

Embed the Helpdesky Contact Form in a v0 by Vercel project. Includes a ready to paste AI prompt for the v0 chat.

Adding a Contact Form to v0 by Vercel gives your visitors a clean way to reach you, with no backend code. 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 beats wiring up a server action just for contact: the Free plan covers your first 15 conversations every month, there is no SMTP or backend setup, and the embed is one client component on your v0 generated contact page. Replies you send from the Helpdesky inbox are emailed straight back to the visitor.

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

v0 generates Next.js components by default. The cleanest place for the embed is a client component on your contact page, using Next's built in <Script> component so the script loads exactly once and survives client side navigation:

"use client";
import Script from "next/script";

export default function ContactPage() {
  return (
    <>
      <div id="hdh-contact-form" />
      <Script
        src="https://helpdesky.io/contact-form.js"
        data-helpdesk-id="YOUR_HELPDESK_ID"
        strategy="afterInteractive"
      />
    </>
  );
}

If v0 generated a server component, mark it "use client" first or move just the form into a small client component.

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 next.js app generated by v0. use the next/script component with strategy="afterInteractive" inside a client component for the contact page.
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 what the Helpdesky AI agent skill installs, so v0 follows the real embed format and the Next.js placement notes. With MCP connected the agent also does the dashboard work: messaging enabled, your domain on Allowed Embed Domains, and the snippet fetched with your Helpdesk ID already filled in. Without MCP it asks you for the ID and you make those two changes in the dashboard.

Test It

Open the v0 preview, submit a test message, and confirm it lands in your Helpdesky Messages inbox. If the script fails to load, check the Network tab for a CSP violation. v0's default Vercel project does not block third party scripts, but a custom next.config.js CSP header might.

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.

Answer Form Submissions with an AI Agent

The generated page collects the messages, and an AI agent can answer them. Under Inbox → AI Agents (beta), create an agent and pick its Mode: Review parks each draft in the inbox for one click approval, Autopilot sends on its own within the pacing and guardrails you set.

Then switch on Contact form under Behaviour → Channels so the agent handles conversations that start on your v0 site. Visitors receive the reply by email, the same way they would a reply you typed.

The agent runs on your own AI provider key from Settings → AI Settings; add one before switching the agent on. See Set Up Your First AI Agent for the walkthrough and the guardrails and pacing guide for delays, daily caps and hand off rules.

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: the Helpdesk ID is in your client bundle, so stop other sites from using it to load your form. Under Settings → Messages → Allowed Embed Domains, add your Vercel domain and your custom domain; subdomains are included automatically, and an empty list allows every domain. Details in Restrict Embeds to Specific Domains.

  2. Make the form yours: need an order number or a department picker? Custom Fields (Text, Text Area, Dropdown, Checkbox, Number) sit between Email and Message and can be required. Labels, placeholders, the button text and the success text are all editable, so the form can be in your site'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). The Contact Form Setup Guide covers each setting.

Last updated on October 13, 2026