Integrations
One page per stack. Each repeats the minimal snippet and links to the copy-paste sample folder on GitHub.
Every integration targets the same endpoint, POST https://api.contactusiq.com/s/{formPublicId}, so the choice is about how the page is built, not about the API. All samples use the placeholder form id au_xxxxxxx and the Turnstile site key placeholder 0x4AAAAAAA_PLACEHOLDER; replace both with the values on your form's Snippet screen.
| Stack | Guide | Sample folder | Shape of the integration |
|---|---|---|---|
| Plain HTML | Plain HTML form | samples/html-form | A form with an action URL. No JavaScript required. |
| Any page | JavaScript embed | samples/js-embed | One script tag and one div; fields and theme come from the dashboard. |
| Vanilla JS | JSON fetch | samples/json-fetch | fetch with JSON, inline thank-you, handles 400 and 429. |
| React | React | samples/react | A hooks-only component with Turnstile via the explicit API. |
| Next.js | Next.js | samples/nextjs | App Router page plus client component; optional proxy route. |
| Astro | Astro | samples/astro | A .astro page with the HTML form, or the embed with is:inline. |
| WordPress | WordPress | apps/wp-plugin and samples/wordpress-shortcode | The plugin (block, shortcode, widget, Contact Form 7 adapter) or a one-file shortcode. |
| Webflow, Squarespace, Wix | Site builders | guide only | Custom-code embed of the HTML form or the script tag. |
| Any HTTP client | curl | samples/curl | Form-encoded, JSON, multipart, idempotency key, honeypot negative test. |
Choosing a flavour
- Plain HTML form when the site is static, you want zero JavaScript, or you want a redirect to your own thank-you page. Works with JavaScript disabled.
- JavaScript embed when you want the form's fields, labels and theme managed in the dashboard so changes appear without a deploy.
- JSON fetch (including the React and Next.js components) when the page is an app that should stay put and show an inline result. JSON posts from a browser are cross-origin, so the page must be served from a verified domain for the CORS preflight to succeed.
What every integration needs
- A verified domain in the workspace and a published form on it.
- The form's public id, and the Turnstile site key if the page renders Turnstile itself.
- An empty hidden
_honeypotfield (the embed and widget add their own). - To be served over HTTPS from the verified domain when testing.
localhostandfile://are never verified; a form can be set to allow any origin for development.