NexusKit

Guide

React Contact Form

Wire a React contact page to NexusKit Contact API in four steps. Works with any React framework — Next.js, Vite, Remix, or plain CRA.

Start freeAll developer resources

Setup steps

1

Create your account

Sign up at app.nexus-kit.com/en/signup. No credit card required.

2

Enable Contact and create a form

In your dashboard, go to Modules → Contact and create a new form. Copy the form ID.

3

Create an API key

Go to Developers and create a key with contact:write scope.

4

POST from React

Add these environment variables to your React site:

NEXUSKIT_API_URL=https://api.nexus-kit.com
NEXUSKIT_API_KEY=nk_live_...
NEXUSKIT_FORM_ID=...

Example: Submit on form send

Call the public Contact API when the user submits your form.

await fetch(`${import.meta.env.VITE_NEXUSKIT_API_URL}/v1/public/contact/forms/${import.meta.env.VITE_NEXUSKIT_FORM_ID}/submissions`, {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${import.meta.env.VITE_NEXUSKIT_API_KEY}`,
  },
  body: JSON.stringify({
    locale: 'en',
    turnstileToken,
    payload: { name, email, message, website: '' },
  }),
});

See also docs/examples/contact-react-snippet.tsx in the monorepo.

Ready to build?

Create a free account and start shipping in minutes.