A
API key encryption at rest#
API key encryption at rest means storing third-party credentials in a database only in encrypted form, so a leaked database dump or backup does not expose usable keys.
The usual choice is an authenticated cipher such as AES-256-GCM, which detects tampering as well as hiding the value. The encryption key lives outside the database, typically in an environment variable or a secrets manager, and the app decrypts a credential only when it calls the provider. Encryption at rest does not protect against an attacker who controls the running server, so it adds to access control rather than replacing it.
In OSForms: Integration configs (Resend API keys, Google refresh tokens, webhook secrets) are encrypted with AES-256-GCM using a random IV per value, and decrypted only when an integration runs.
Read next: BYOK for form backends: what bring your own key means →
application/x-www-form-urlencoded is the default encoding a browser uses to submit an HTML form that has no enctype attribute: each field becomes a percent-encoded name=value pair, and pairs are joined with an ampersand.
A form with name and email fields sends a body like name=Ada+Lovelace&email=ada%40example.com (spaces become +). Every server framework parses it, but it carries only text, so a file input sends just the file name. Fields that share a name, such as a group of checkboxes, appear as repeated pairs.
In OSForms: The submission endpoint parses urlencoded bodies and collects repeated field names into an array.
Read next: How to make an HTML contact form that sends email →
Auto-reply (autoresponder)#
An auto-reply, or autoresponder, is an email sent automatically to the person who submitted a form, usually to confirm that their message arrived.
Sending one needs three things: the submitter’s address from a field in the submission, a verified sending domain, and a template. Because the recipient address comes from user input, a bot can use an unprotected form to send your auto-reply to people who never filled it in, so pair auto-replies with spam protection. Keep the content short and transactional so mailbox providers do not treat it as marketing.
In OSForms: The Resend email integration can send an auto-reply from your own Resend account. It uses the email field you name, or detects a common one such as email, and supports {{field}} placeholders in the subject and body.
Read next: How to send contact form email with Resend →
C
CAPTCHA#
A CAPTCHA is a challenge-response test that tries to tell human visitors from automated scripts before a form submission is accepted.
Form CAPTCHAs run as a widget that writes a token into a hidden field. The server sends that token and a secret key to the provider’s siteverify endpoint and rejects the submission if verification fails, so the check has to happen server side. Google reCAPTCHA v2 shows a checkbox or image challenge, reCAPTCHA v3 runs invisibly and returns a score from 0.0 (likely bot) to 1.0 (likely human), hCaptcha is a privacy-focused alternative, and Cloudflare Turnstile usually passes without any visible challenge.
In OSForms: reCAPTCHA v2 and v3, hCaptcha, and Cloudflare Turnstile are supported. OSForms picks the verifier from the token field the widget posts (g-recaptcha-response, h-captcha-response, or cf-turnstile-response), rejects reCAPTCHA v3 scores below 0.5, and strips the token before storing. The secret key is set through the forms API (recaptchaSecret).
Read next: Docs: the submission endpoint →
A conversational form shows one question at a time in a full-screen or chat-like flow, instead of presenting every field on a single page.
Typeform made the pattern popular. One question per screen can make long surveys and onboarding flows feel lighter, and lets later questions depend on earlier answers. For short forms, such as a three-field contact form, a classic layout is usually faster to scan and fill. Accessibility needs deliberate work: focus management, keyboard navigation, and announcing progress to screen readers.
In OSForms: The OSForm component in @osforms/react renders a form schema in conversational mode (the default) or classic mode, with Enter to advance and a progress bar.
Read next: How to add a conversational form to React →
CORS and allowed origins#
CORS (Cross-Origin Resource Sharing) is the browser mechanism that decides whether JavaScript running on one origin may read the response to a request it sent to a different origin.
A fetch() from your site to a form backend on another domain only succeeds in script if the backend answers with a matching Access-Control-Allow-Origin header, and a JSON request triggers an OPTIONS preflight first. A plain HTML form post is a page navigation, so CORS does not apply to it. Browsers enforce CORS, not servers, so it never stops curl or a bot; a server-side allowed-origins list, which rejects requests whose Origin header is not listed, stops other websites from posting to your endpoint from the browser.
In OSForms: Each form has an optional allowed-origins list. A submission whose Origin header is not on the list gets a 403; requests that send no Origin header, such as server-to-server calls, are not blocked. An empty list accepts every origin.
Read next: How to build a Next.js contact form without a database →
F
The action attribute of an HTML form element is the URL the browser sends the form data to on submit, and the method attribute sets the HTTP method, GET or POST.
With method="get" the fields are appended to the URL as a query string, which suits search forms but puts the data in browser history and server logs. method="post" sends the fields in the request body and is the right choice for anything that stores data, like a contact form. A form without an action submits to the current page URL, and the enctype attribute sets how a POST body is encoded.
In OSForms: Set action to your form endpoint, https://osforms.com/api/v1/f/{slug}, and method to post.
Read next: How to make an HTML contact form that sends email →
A form backend is a hosted service that receives HTML form submissions at a URL, stores them, and forwards them to email or other tools, so a website needs no server code of its own to process forms.
Handling a form POST yourself means running a server, parsing the body, filtering spam, storing the data, and sending email. Static sites and front-end apps skip that by pointing the form’s action (or a fetch() call) at a form backend endpoint. Services differ mainly in spam protection, integrations, data export, pricing, and whether you can self-host.
In OSForms: OSForms is an open-source (MIT) form backend with 100 free submissions a month. Resend email, Google Sheets, and webhook integrations run on your own keys.
Read next: What is a form backend? (And how to set one up) →
A form endpoint is the URL that accepts submissions for one specific form, usually containing a unique ID that tells the backend which form and account the data belongs to.
An endpoint is public by design: it sits in your page source, so anyone can find it and post to it. That is why endpoints rely on server-side controls such as rate limits, honeypot fields, CAPTCHA, and origin checks rather than on keeping the URL secret. A good endpoint accepts the common body encodings and answers browser posts with a redirect and script requests with JSON.
In OSForms: Each form gets an endpoint at /api/v1/f/{slug}, where the slug is a random 12-character ID. It accepts urlencoded, multipart, and JSON bodies.
Read next: Docs: the submission endpoint →
A form submission is one set of field values sent from a form to a server, together with the request metadata that arrives with it.
Servers usually store a submission as a record holding the field data, a timestamp, and metadata such as IP address, user agent, and origin, which help with spam analysis and debugging. Field names come from each input’s name attribute; an input without a name is never sent, a common cause of "missing" fields. Unchecked checkboxes are left out of the body too.
In OSForms: Each stored submission keeps the field data plus IP address, user agent, and origin. The pull API returns only the field data and timestamp, never that metadata.
Read next: How to handle form submissions without a backend →
H
A headless form is a form whose markup, styling, and validation you write yourself, sent to a backend that only receives and processes the data and imposes no UI.
Headless is the opposite of an embedded form builder that renders its own iframe or widget. You keep full control of design, accessibility, and client-side validation in your own codebase, and the backend accepts whatever field names you send. The cost is that you write the HTML or components, and the backend cannot validate fields it knows nothing about.
In OSForms: A form created without the form builder is headless: its endpoint accepts any field names. Forms made with the builder store a schema that @osforms/react can render.
Read next: How to make an HTML contact form that sends email →
HMAC signature#
An HMAC signature is a hash of a message computed with a shared secret key, for example with HMAC-SHA256, and sent alongside the message so the receiver can confirm who sent it and that the body was not changed.
The sender computes the HMAC over the exact request body and puts the result, usually hex, in a header. The receiver recomputes it over the raw body bytes it received, before any JSON parsing or re-serializing, and compares the two in constant time (in Node, crypto.timingSafeEqual). Without the secret nobody can produce a valid signature, which is what makes a public webhook URL safe to expose.
In OSForms: When a webhook has a secret, OSForms sends an X-osforms-Signature header: the raw hex HMAC-SHA256 of the JSON body, with no sha256= prefix.
Read next: Docs: webhooks and signature verification →
Honeypot field#
A honeypot field is a form input hidden from human visitors but present in the HTML, so automated bots fill it in; a submission with the honeypot filled is treated as spam.
Simple bots fill every input they find, so an empty honeypot is a cheap sign of a real person. Hide it with CSS, for example positioned off screen, and add tabindex="-1", autocomplete="off", and aria-hidden="true" on its wrapper so keyboard users, screen readers, and autofill skip it. A honeypot adds zero friction for people but does nothing against targeted or browser-driven bots, so pair it with a CAPTCHA or rate limit.
In OSForms: You choose the honeypot field name per form. If that field arrives non-empty, OSForms returns a normal success response but does not store the submission or run integrations.
Read next: How to make an HTML contact form that sends email →
R
Rate limiting#
Rate limiting caps how many requests a client can make within a time window, such as 10 submissions per minute from one IP address, and rejects the excess.
On a form endpoint, rate limiting slows down floods and scripted spam and protects downstream quotas such as your email provider’s. Rejected requests should get HTTP 429 Too Many Requests, ideally with a Retry-After header. Many people can share one IP address behind an office network or mobile carrier, so set per-IP limits high enough not to block real visitors.
In OSForms: Each form has a per-IP limit, 10 submissions a minute by default and configurable per form. Requests over the limit get a 429 with Retry-After.
Read next: Docs: the submission endpoint →
Redirect after submit (Post/Redirect/Get)#
Redirect after submit, also called Post/Redirect/Get (PRG), is the pattern where a server answers a form POST with a redirect, usually 303 See Other, to a separate thank-you page instead of returning a page directly.
A 303 tells the browser to load the new URL with GET, so refreshing the thank-you page does not resend the form and create a duplicate submission. Without it, reloading after a POST shows the "confirm form resubmission" prompt. Forms that submit with fetch() do not need a redirect: the server returns JSON and the script updates the page.
In OSForms: Set a redirect URL on the form and browser posts get a 303 to it. Without one, or for JSON requests, the endpoint returns JSON.
Read next: What is a form backend? (And how to set one up) →
S
A self-hosted form backend is form-processing software you run on your own server or cloud account, so submissions never pass through a third-party service.
Teams self-host for data residency, compliance, or to remove usage limits. The cost is operations: you run the app and its database, apply updates, take backups, and own email deliverability. An open-source license is what makes self-hosting possible, and if the hosted and self-hosted versions share the same API, moving between them only changes the endpoint URL in your forms.
In OSForms: OSForms is MIT-licensed and runs with one docker compose up (the app plus MongoDB). The self-hosting guide lives in the GitHub repo.
Read next: Self-hosting guide on GitHub →
Spam submission#
A spam submission is an unwanted form entry sent by a bot or a person, usually carrying links, ads, or phishing content instead of a genuine message.
Every public form endpoint gets spam eventually, because bots crawl the web for forms and post to them automatically. Defenses work in layers: a honeypot field catches simple bots, rate limiting slows floods, a CAPTCHA stops most automated posting, and an allowed-origins list stops other sites from posting to your endpoint from the browser. Server-side validation, such as required fields and length limits, filters much of what is left.
In OSForms: Honeypot field, CAPTCHA, per-IP rate limit, and allowed origins are all set per form.
Read next: How to handle form submissions without a backend →
A static site form is an HTML form on a website served as prebuilt files, for example from GitHub Pages or a storage bucket, where no server-side code runs to receive the submission.
Static hosts serve files but do not run your code on a POST, so the form has to send its data somewhere else: a form backend, a serverless function, or a third-party API. Pointing the form’s action at a form backend endpoint is the shortest path and works with plain HTML and no JavaScript. Hugo, Jekyll, Eleventy, and Astro in its default static mode all produce this kind of site.
In OSForms: Point the form’s action at your OSForms endpoint; no JavaScript is required.
Read next: How to handle form submissions without a backend →
W
Webhook#
A webhook is an HTTP request that one service sends to a URL you provide when an event happens, such as a new form submission, so your code can react without polling.
Your endpoint receives a POST with a JSON payload and should return a 2xx status quickly; slow or failing endpoints cause timeouts and, with some senders, retries. The URL is reachable by anyone, so verify an HMAC signature before trusting the payload. Webhooks connect a form to anything without a built-in integration: Slack, a CRM, an automation tool such as Zapier or Make, or your own API.
In OSForms: Each submission sends a form.submission event (form ID and name, submission ID, timestamp, field data) by POST, PUT, or PATCH with a 30-second timeout. A failed delivery is logged and triggers an in-app notification and email alert; it is not retried automatically.
Read next: Docs: webhooks and signature verification →
Webhook replay attack#
A webhook replay attack is when an attacker captures a genuine, correctly signed webhook request and sends it again later, so the receiver processes the same event twice.
A signature alone does not stop a replay, because the replayed request is byte-for-byte authentic. The two common defenses are a signed timestamp that the receiver rejects once it is a few minutes old, and an idempotency check that records each event ID and ignores repeats. Serving the webhook URL over HTTPS also makes capturing a request much harder in the first place.
In OSForms: The signature covers the body only and no timestamp header is sent, so make your handler idempotent by recording the submissionId from the payload and skipping IDs you have already processed.
Read next: Docs: webhooks and signature verification →
Point your form at OSForms
Bring your own API keys. 100 free submissions a month, with Resend, Google Sheets, and webhooks included.
Open source (MIT). Self-host it if you prefer.