The Wix CLI is in Developer Preview and is subject to change.
CLI Documentation Notice
You're viewing documentation for the new Wix CLI, which we recommend for all new projects. Determine which CLI your project uses.
Previous CLI documentation:
Note: Currently, site plugins built with the CLI aren't supported on the checkout page. If you want to build a plugin for the checkout page, you can build it with Wix Blocks.
The Wix CLI makes it easy to add and develop site plugins in your app project. These are considered app extensions, and appear on the Extensions page in your app's dashboard.
With site plugins, you can create interactive and feature-rich components that seamlessly integrate into Wix’s business solutions, such as Wix Stores and Wix Bookings, extending their functionality and user experience.
Wix users can easily place site plugins into predefined slots (UI placeholders) within apps built by Wix, using the plugin explorer available in all Wix editors.
Site plugins in the CLI are built with custom element technology. The custom element is essentially a new HTML tag that you define, which is made available in the Wix editors as a plugin.
The Wix CLI creates the necessary files with template code so you can easily start developing your site plugin. It also calls define() for the custom element that the site plugin is built on, so you don't need to explicitly call it in your code.
Follow the instructions below to:
In the terminal:
Navigate to your project repo.
Run the generate command.
The CLI displays a menu of extensions to generate. Select Site Plugin to continue. The CLI then prompts you for the following items:
Site plugin folder: The name of the folder in the project repo that contains the custom element code that the site plugin is built on.
Site plugin name: The name of the plugin that appears in the your-plugin-name.extension.ts configuration file, and in the app dashboard.
Wix app: The Wix business solution (app made by Wix) whose slot you want to add your plugin to.
Slot: The slot you want to add your plugin to. Use the arrow keys to navigate the list.
Note: You can only choose one slot when generating your plugin, however, you can add more slots later by adding them to the plugin's your-plugin-name.extension.ts file.
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 site plugin extension files.
Follow the steps below to test your site plugin:
Checkout plugins
If you are building a plugin for the checkout page, you must create a dashboard page to provide users with a way to add the plugin to their site.
If your plugin requires a back office management interface, you can create one either within the Wix dashboard, or as an external dashboard on a third-party platform. Learn about building a dashboard page to manage your site plugin.
Once your project is ready for production, you can build and deploy it.
An app version allows you to publish an app to the Wix App Market or install it on a site with a direct install URL. You can view your app versions in the app dashboard.
For more information about building and deploying your app, see Build and Deploy an App with the Wix CLI.
To delete an existing site plugin extension from your app:
public folder..use() statements for the extension from the extensions.ts file.Note: If you've already created a version of your app, deleting a site plugin's files from your project doesn't remove the site plugin from your app's latest version in the app dashboard. To remove the site plugin, create a new version after deleting the site plugin files.