Next.js for Drupal
This is an example on how to implement webform in Next.js for Drupal.
There are two ways you can submit webforms to your Drupal site: Client side and Server side (API route).
We use the Webform REST module to submit the form values to Drupal.
Server Side (API Route)
We submit the form values to a custom API route first. The API route then submits the form to Drupal using the Webform REST module.
This is useful if we need to hide client IDs and secrets or our Drupal implementation.