A site plugin is a type of component that site builders can place in designated locations (called slots) within Wix apps. Site plugins extend the functionality of their host by providing additional Ul elements and business logic.
To build a site plugin, you need to do the following:
You can create a new app for your site plugin or add it to an existing app.
Checkout plugins
If you're developing a site plugin for the checkout page, there are some special instructions that you must follow. Make sure to pay close attention to the dedicated notes throughout this article.
Note: You can change these settings at any time in the plugin's extension page in the app dashboard.
Make sure to follow our design guidelines.
A plugin communicates with its host widget via an API that the plugin is expected to expose. The host widget uses this API to provide the plugin with data about the context in which it’s running (for example, a reviews plugin exposes a productId
property, which the host widget sets to indicate the item that it’s currently displaying).
Depending on your implementation, your plugin may also need to communicate with external servers.
To implement the plugin API, you first need to add the required properties and functions to your Blocks Widget API. Learn more about the plugin APIs supported on each app page.
You can then get the properties provided by the host widget in your plugin's onPropsChanged()
function, for example:
1
Use Wix Blocks to code your plugin’s business logic. Plugins can use Wix App APIs to access the site’s business data (such as Stores or Bookings data).
Checkout plugins
Because the checkout page is not available in the Wix editors, any options for customizing a checkout plugin's appearance or functionality must be exposed through your app's dashboard page or through your own external interface.
In the Blocks Configuration tab you determine how site builders will interact with your plugin when they add it to their site using any of the Wix editors. You have full control over what users will be able to change in the widget’s design and layout and how it behaves in editing time. You can also build an integrated settings panel, enabling site builders to customize the 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 extension
To let users add your plugin to their site through your app's dashboard page, create a user interface that triggers the Wix Dashboard API's addSitePlugin()
function. Specify the desired slot when calling this function. This initiates a user flow where Wix requests the user's consent to add the plugin. If the selected slot is already occupied, the user can choose to replace the existing plugin with your plugin. Plugins for the checkout page must implement this functionality to enable users to add the plugin to their site.
Depending on the framework you're using to develop your dashboard page, use one of the following APIs:
について addSitePlugin()
function takes the following parameters:
pluginId
: ID of your site plugin, which you can find in your app's site plugin extension. To view the extension, go to your app's dashboard in the Wix Studio workspace.placement
: Details of the slot in which you want to add the plugin, including the hosting app's appDefinitionId
, and the relevant widgetId
そして slotId
. Learn more about the locations and identifiers of slots that are available on Wix app pages.The following example shows how to use Velo in Blocks to add a site plugin to the checkout page when a user clicks an Add Plugin button in the dashboard:
1
You can check whether your plugin is currently placed in a slot on a specific site. Depending on the framework you're using to develop your dashboard page, use one of the following APIs:
Both APIs return an array of objects indicating whether each of your app's site plugins is currently placed in a slot on the user's site.
例えば、こうだ:
1
You can configure various settings, including the plugin's installation settings and market listing, in your app's site plugin extension page in the app dashboard. You can navigate to this page directly from the Blocks editor.
Your plugin's market listing determines how it will appear to users in the plugin explorer in the editors, including the plugin's name, icon, and teaser.
Note: The plugin's market listing is different from the app's market listing, which determines how the entire app appears in the Wix App Market.
Plugin name: The plugin name that is displayed to users.
Which Wix app does it extend?: The Wix app for which you're building the plugin.
Slots this plugin can be added to: Select one or more slots that are appropriate for your plugin. Select slots in order of priority. If none of the selected slots are available, users can choose to replace a plugin that’s already been added.
Add this plugin automatically to the site: Whether the plugin is automatically added to a slot when a user installs your app.
Checkout plugins
Note that plugins for the checkout page cannot be added automatically on installation.
Teaser: A short promotional description for your plugin's market listing.
Icon: An icon for your plugin's market listing. Upload a square JPG or PNG file.
Note: If you set your plugin to be automatically added to a slot on installation, it will be placed in the first available slot according to the order you defined. If that slot is occupied, it will be added in the next available slot, and so on. If there are no available slots, it will not be added.
Your unpublished plugins are available for installation in the editors when you're logged in with your developer account. This makes it easy to preview and test your plugin in a real environment.
Checkout plugins
If you're developing a plugin for the checkout page, you won't be able to test it in the editor. See how to test a checkout plugin.
To test your plugin in the editor:
Once you install your plugin on a site, you can preview or publish the site to test the plugin's functionality and make sure it's working properly.
If you're developing a plugin for the checkout page, make sure you've set up a way to install your plugin from the dashboard and then do the following:
When you’ve finished building and testing your plugin, you’re ready to launch and monetize your app.
Learn more about submitting your app for review.