JavaScript

JavaScript contact form for any website

Add a JavaScript contact form to your website with the FormsReach SDK. No custom submit handler, no serverless route, no DIY email pipeline. Deliver submissions by email with spam filtering and to WhatsApp in seconds, metered with monthly credits.

Set up FormsReach with JavaScript

Connect your form in a few steps. No custom backend required.

  1. 1

    Get your API key

    Create an account at FormsReach and copy your API key.

  2. 2

    Add the CDN script and init

    Include the official browser build from unpkg (@formsreach/js), then call FormsReach.init({ apiKey: 'YOUR_API_KEY' }).

  3. 3

    Mark the form

    Add data-formsreach on your form. Use named inputs (name, email, message). Submit a test and verify email and/or WhatsApp delivery.

JavaScript snippet

Copy this into your project, then swap in your FormsReach API key.

          <script src="https://unpkg.com/@formsreach/js/dist/formsreach.min.js"></script>

<script>
  FormsReach.init({ apiKey: 'YOUR_API_KEY' });
</script>

<form data-formsreach>
  <input type="text" name="name" required>
  <input type="email" name="email" required>
  <textarea name="message" required></textarea>
  <button type="submit">Submit Form</button>
</form>
        

Why add a small JS SDK?

Some sites want client-side submit handling without standing up their own API route. The FormsReach browser SDK posts to the same form backend as the HTML action endpoint, so you stay off the email-only mailto path and off custom serverless.

Platform notes

Troubleshooting

What you get

Monthly credits for submissions and delivery. Scale when volume grows.

Free

500 credits every month for form submissions, email, webhooks, and workflow rules. Spam filtering included. No credit card required.

Starter, Pro & Agency

Larger monthly credit pools (2,000 / 5,000 / 18,000). WhatsApp via Meta Business API unlocks on Pro and Agency. See pricing.

FAQ

Common questions about FormsReach with JavaScript.

Where is the official JS package?+

https://github.com/formsreach/sdk - browser build via unpkg: https://unpkg.com/@formsreach/js/dist/formsreach.min.js

How is this different from the plain HTML form?+

HTML POST works with zero JavaScript. The JS SDK is for progressive enhancement and client-side submit handling with the same FormsReach backend.

Does Free include WhatsApp and email?+

Free includes email, webhooks, and workflow rules with 500 credits every month. WhatsApp is available on Pro and Agency.

Can I use npm instead of the CDN?+

Yes - the monorepo ships @formsreach/js. The marketing snippet uses the CDN for the fastest copy-paste path.

More framework guides that use the same FormsReach form API.

Ready to receive form leads?

Create a free API key. Upgrade when you need more monthly credits.