The dashboard is the control center for Wix sites. It allows users to manage their sites' settings and business features. The dashboard also includes tools for such as analytics, eCommerce, and marketing. Third-party apps can create custom dashboard integrations, including pages and widgets, that are displayed in the dashboards of users who install those apps as iFrames embedded to the Dashboard.
The Dashboard API allows you to write code in custom dashboard extensions to interact with other parts of the Wix dashboard. Using the API, developers can navigate users to pages in the dashboard, display modals, and send users alerts and updates using toasts. The API makes it easy to create custom experiences for users in their sites' dashboards.
In order to use the Dashboard API, install the @wix/dashboard
package:
To use the Dashboard API in Wix-hosted apps, import the dashboard
module in your code and call it's methods directly.
To use the Dashboard API in self-hosted apps, first create a client using the dashboard
module:
Then, use the client to call dashboard
module's methods.
For example:
When you make API calls from your dashboard extension code, you need to keep in mind which permissions are available. Your code can access APIs with the permissions of the currently logged-in user, but only if the app your code is running on has also been granted those permissions.
For example, if your app has permissions to add products to a store, but the current user does not, your app will not be able to use the stores
API to add products to the store. Conversely, if the current user has permissions to add products to a store, but your app does not, your app will not be able to add products to the store. The only way your app can add products to a store is if both your app and the current user have permissions to do so.
Before you start writing your code, keep in mind that the heights of any dashboard components rendered within iframes are automatically adusted. Because of this, do not use relative CSS height units such as vh
in your iframe component code.
If you are using one of the legacy Wix APIs and require a method that is not available in the Dashboard API, or alternatively if you would like to suggest a use case that fits the Dashboard API, reach out to Dashboard API Support for assistance.