Form Integration

Replit contact form, no Express route required

Ask Replit Agent for a contact form and you may get an Express route, a database table and an SMTP setup. You can skip all of it. The form posts to Formbold from the browser, the message is stored and emailed, and there's no Secret to add because the endpoint is public by design.

Contact Form for Replit

What does the Formbold helper look like?

Replit apps use whatever stack Agent picked, so this helper is plain TypeScript. Call it from React, Vue, Svelte or a vanilla script. Swap FORM_ID for yours.

replit.js
// formbold.ts : a small helper that works in any browser frontend Agent builds
// (React, Vue, Svelte or plain TypeScript). The endpoint is public, so no Secret is needed.
export const FORMBOLD_ENDPOINT = "https://formbold.com/s/FORM_ID";

export type SendResult = { ok: true; message: string } | { ok: false; message: string };

export async function sendToFormbold(form: HTMLFormElement): Promise<SendResult> {
  const fields = Object.fromEntries(new FormData(form).entries());

  try {
    const res = await fetch(FORMBOLD_ENDPOINT, {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
      },
      body: JSON.stringify(fields),
    });
    const data = await res.json().catch(() => ({} as { message?: string }));
    return res.ok
      ? { ok: true, message: data.message ?? "Sent. Thanks for writing in." }
      : { ok: false, message: data.message ?? `Request failed (${res.status}).` };
  } catch {
    return { ok: false, message: "Network problem. Check your connection and try again." };
  }
}

// Usage in a React component:
// const r = await sendToFormbold(event.currentTarget);
// setStatus(r.message); if (r.ok) event.currentTarget.reset();
How it works

How do I add Formbold to an app Replit Agent built?

None of this touches your server code. You'll test twice: once in Preview, once on the deployed URL.

1

Create a Formbold form

Open All Forms, click Create New Form and copy the https://formbold.com/s/FORM_ID endpoint from Form Setup.

2

Ask Agent for the change

"Add a file formbold.ts with a sendToFormbold(form) helper that POSTs the form fields as JSON to https://formbold.com/s/FORM_ID with Content-Type and Accept set to application/json, and returns ok plus a message. Use it in the contact form submit handler, show the message to the user, and reset the form on success. Do not add a backend route, email library or database table for this."

3

Test in Preview, then publish

Submit once in the Preview pane, check Submissions in Formbold, then publish from the Publishing tool and test again on the live URL.

Features

What do you save by not building the backend on Replit?

On Replit, a contact form tends to grow into a route, a mail provider and a table. This is what you get instead.

No SMTP credentials

Formbold sends the notification email, so there is no mail API key sitting in your Secrets tool.

Nothing to rotate between environments

Replit keeps development and production secrets separate. The Formbold endpoint is not a secret, so there is nothing to copy across.

Junk stays out of your inbox

Turn on Basic Spam Filter and anything flagged goes to the Spam folder in Submissions.

Files on Starter and up

Starter, Premium and Business accept uploads at 10 MB, 25 MB and 50 MB. Send FormData without a Content-Type header for those.

Pull entries into your app

The REST API at https://api.formbold.com/api works on every plan. Call it from your server code with a token stored in Replit Secrets.

FAQs

Replit questions: deployments and Secrets

Deployments, Secrets and the gap between Preview and production.

Replit says Static deployments are not compatible with apps Agent created, because those need a backend. Use Autoscale, the default. Formbold itself works from any deployment type.

Still have a question?

The docs cover setup, framework guides, integrations and spam protection, step by step.