Dashboard React SDK

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
1

Install using yarn

Copy
1

Usage

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

Copy
1

Use dashboard APIs

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

For example:

Copy
1

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
1
Was this helpful?
Yes
No