Skip to content

A server-rendered Next.js form

Read the form on the server with getForm: it is in the HTML from the start, better for SEO and display. The client component does the rest.

Request access The detailed guide

In three steps

  1. Step 1 : Install the SDK: npm install @canardform/sdk.

  2. Step 2 : In your page (App Router), read the form with getForm.

  3. Step 3 : Pass it to the <CanardForm> client component.

// app/contact/page.tsx
import { getForm } from '@canardform/sdk';
import ContactForm from './ContactForm';

export default async function ContactPage() {
    const definition = await getForm('YOUR_FORM');

    return <ContactForm definition={definition} />;
}

What you gain

Frequently asked questions

Why two files, with 'use client'?

The page stays a server component: it reads the form with getForm, so it is in the HTML from the start. Typing and sending happen in the browser, hence the small client component.

Do I need an API route or a Server Action to receive answers?

No. The browser sends straight to Canard Form, without a key: nothing to write on the server. If your backend must react to an answer, plug in a signed webhook.

Your first form is 5 minutes away.

Free to start. Change plans only when you need to.