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.
Notes:
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 app created by Wix whos widget you want to add your plugin to. You can find the IDs of these apps in this list of apps created by Wix. |
widgetId | string | ID of the host widget in which the slot is located. A host widget is a widget provided by an app created by Wix. Check the slots documentation to find the IDs of site widgets provided by apps created by Wix. |
slotId | string | ID of the slot in the host widget. |
The addSitePlugin()
method 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 call this method in self-hosted apps, you need to create a client. See the setup guide for more details.