Service plugin extensions are a set of APIs defined by Wix that you can use to inject custom logic into the existing backend flows of Wix business solutions or to introduce entirely new flows to Wix sites.
You can implement service plugin extensions in your project using the Wix CLI.
Follow the instructions below to:
Once this task is complete, your project will have a service plugin extension with custom functions that Wix calls during a specific flow.
In the terminal:
Navigate to your project repo.
Run the generate command.
The CLI will display a menu of extensions to generate. Select Service Plugin and hit enter to continue.
The CLI will prompt you to select a service plugin from a list of available service plugins.
The CLI will prompt you to name your service plugin. This is the name of the folder in the project repo that contains the service plugin code. Only you will see this name.
Upon completion, the extension files will be created in your project directory with the following structure:
Note: This is the default folder structure created by the CLI. You can move these files to any location within the src/ folder and update the references in your extension.ts file. Learn more about the flexible file system.
Learn more about the service plugin extension files.
To test your service plugin extension you must:
For example, to test a service plugin extension for Additional Fees that adds a $5 packaging fee to all orders:
New service plugins or changes to existing service plugins won't take affect until you've built and released your project.
Once your project is ready for production, you can build and deploy it.
To delete a service plugin extension from your project:
src/extensions that contains your service plugin extension's files..use() statements for the extension from the extensions.ts file.Important:
If you've already released a version of your project, you must build and deploy the project again after removing the service plugin extension files.