addSitePlugin

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.

Signature

Copy

Parameters

NameTypeDescription
pluginIdstringID of your site plugin, which you can find in your app's dashboard, in the site plugin extension's settings.
optionsaddSitePluginOptionsOptions to use when adding a site plugin.

addSitePluginOptions object

Copy
NameTypeDescription
placementPluginPlacementOptional. 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.

PluginPlacement object

Copy
NameTypeDescription
appDefinitionIdstringID of the Wix business solution to which you want to add your plugin.
widgetIdstringID of the host widget in which the slot is located.
slotIdstringID of the slot.

Returns

Copy

Errors

The addSitePlugin() function can reject with the following errors:

CodeMessage
3001Slot occupied
3002Slot not found
3003Error adding plugin
3004Error replacing existing plugin
3005Error loading modal data
3006Aborted by user
3007Site not published yet

Examples

Note: To use this method in self-hosted apps, you need to create a client. See the setup guide for more details.

Add a site plugin to a specific slot

Copy

Add a site plugin without specifying a slot

Copy
Was this helpful?
Yes
No