A Next.js form that posts to a Discord channel
Submit from a client component straight to your endpoint and add a Discord destination with a channel webhook. There is no /api route to write and no bot to host. Discord delivery is on Pro and Agency.
Setting it up
01Submit from the client
The browser posts directly to the endpoint, so the submission carries the visitor's own IP and user agent, which is what the spam filter scores.
app/contact/contact-form.tsx"use client"; import { useState } from "react"; export function ContactForm() { const [status, setStatus] = useState<"idle" | "sent" | "error">("idle"); async function onSubmit(event: React.FormEvent<HTMLFormElement>) { event.preventDefault(); const form = event.currentTarget; const res = await fetch(form.action, { method: "POST", body: new FormData(form), headers: { Accept: "application/json" }, }); setStatus(res.ok ? "sent" : "error"); } return ( <form action="https://send.webforms.to/wft_your_key" method="POST" onSubmit={onSubmit}> <input name="email" type="email" required /> <textarea name="message" required /> <button type="submit">Send</button> {status === "sent" ? <p role="status">Sent.</p> : null} </form> ); }02Create the channel webhook
In Discord, open Channel Settings, then Integrations, then Webhooks, create one and copy the URL into a Discord destination on the form.
What is different about Next.js and Discord
A Server Action hides the visitor from the spam filter
It is tempting to forward the form from a Server Action to keep the endpoint out of client code. The request then comes from your server, so every submission shares one IP and the per-visitor signals the filter relies on disappear. The endpoint key is public by design; lock the form to your domain in the dashboard instead.
Long messages are cut in the embed, not lost
Discord embeds allow 1024 characters per field. A long message is truncated in the channel and kept in full in the dashboard, so link the team to the dashboard for anything longer than a paragraph.
It works on a static export
A form posting from the browser needs no server, so output: 'export' builds on any CDN post to Discord exactly the same.
The full guides cover each side on its own: Next.js setup and Discord as a destination.