Developer Preview
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Adds a site plugin to one of the slots supported in an app created by Wix. You can specify a single slot in which you want to add the plugin, or add the plugin to one of the available slots based on a list of prioritized slots that you configure in the plugin's installation settings in your app's dashboard.
Note: To use this function, Your app must have a site plugin extension. Learn more about site plugins.
Name | Type | Description |
---|---|---|
pluginId | string | ID of your site plugin, which you can find in your app's dashboard, in the site plugin extension's settings. |
options | addSitePluginOptions | Options to use when adding a site plugin. |
Name | Type | Description |
---|---|---|
placement | PluginPlacement | Optional. Details of the slot in which you want to add the plugin. You can find this information in the articles about the slots that are available on Wix app pages. If you do not include this property, your plugin is placed in the first available slot according to the order you defined in the plugin's installation settings in your app's dashboard. If that slot is occupied, it is added in the next available slot, and so on. If there are no available slots, it is not added. |
Name | Type | Description |
---|---|---|
appDefinitionId | string | ID of the Wix business solution to which you want to add your plugin. |
widgetId | string | ID of the host widget in which the slot is located. |
slotId | string | ID of the slot. |
The addSitePlugin()
function can reject with the following errors:
Code | Message |
---|---|
3001 | Slot occupied |
3002 | Slot not found |
3003 | Error adding plugin |
3004 | Error replacing existing plugin |
3005 | Error loading modal data |
3006 | Aborted by user |
3007 | Site not published yet |
Note: To use this method in self-hosted apps, you need to create a client. See the setup guide for more details.