About the Form Submissions Service Plugin

As a form submission provider, you can integrate with Wix to allow site owners to request and use your services on their Wix sites. By integrating your service with Wix, the service validates and submits a site visitor's form.

The integration is done via an app in the Wix App Market and by implementing the Form Submissions service plugin. After the app is installed on a site, Wix triggers a call to your service whenever a form is submitted on the site.

Before you begin

It’s important to note the following points before starting to code:

  • The Form Submission service plugin only works with the Wix Forms app.
  • There are several apps that use forms. To validate form submission for a specific Wix app, configure your app in the Wix Developers Center for that Wix app by defining the relevant namespace field in the extension. For example, the namespace for the Wix Forms app is "wix.form_app.form".

Terminology

  • Submission: Data received when a site visitor submits a form.
  • Validation: Process that makes sure the information that the site visitor put into a form is correct and meets certain rules.
  • Form: Online interface that allows site visitors to input and submit data.

Get started

Follow these steps to begin implementing your service plugin.

Choose a framework

You can implement this service plugin with the following frameworks:

Configure your service plugin

To configure and customize your plugin, you need to provide important information in the service plugin configuration file. You can configure your plugin in the Wix Dev Center. For details, see Form Submissions Extension Configuration.

Define handler functions

Use formSubmissions.provideHandlers() to define the following handler functions that implement your custom business logic. Make sure you define all required functions.

FunctionRequired
validateSubmission()Yes

Code examples

Below is an example for implementing the Form Submissions service plugin in your code.

CLI: Basic code structure

This is the basic code structure for implementing the Form Submissions service plugin with the Wix CLI:

Copy
import { formSubmissions } from "@wix/forms/service-plugins"; formSubmissions.provideHandlers({ validateSubmission: async (payload) => { const { request, metadata } = payload; // Add your logic here }, });

Self-hosted: Basic code structure

This is the basic code structure for implementing a self-hosted Form Submissions service plugin:

Copy
import { createClient } from '@wix/sdk'; import { formSubmissions } from '@wix/forms/service-plugins' const wixClient = createClient({ auth: { appId: <YOUR_APP_ID>, publicKey: <YOUR_APP_PUBLIC_KEY> }, modules: { formSubmissions } }); wixClient.formSubmissions.provideHandlers({ validateSubmission: async (payload) => { const { request, metadata } = payload; // Add your logic here } }); // Implement a router to process all requests express.post('/plugins-and-webhooks/*', (req, res) => { wixClient.process(req); });

See also

Did this help?