Dashboard React SDK

Deprecated

This module is deprecated. For more information, see Migrating from dashboard-react.

The Dashboard React SDK is a collection of React utilites, components, and hooks that you can use to build Wix dashboard extensions with React. Together with the core React SDK, it provides the tools needed to work with the rest of the JavaScript SDK APIs and dashboard APIs from within React components. You can also use this setup to make calls to Wix's GraphQL API.

Setup

In order to use the Dashboard React SDK, install the @wix/dashboard-react, @wix/sdk-react, and react packages.

Install using npm

Copy

Install using yarn

Copy

Usage

To use the SDK, wrap your React component with the withDashboard() higher-order component:

Copy

Use dashboard APIs

Use the useDashboard() hook to retrieve and use the dashboard APIs.

For example:

Copy

Use JavaScript SDK APIs

When you wrap your component with withDashboard(), a WixProvider component is initialized with the dashboard host and authentication strategy. This allows you to use useWixModules() to retrieve and use JavaScript SDK APIs.

For example:

Copy
Was this helpful?
Yes
No