React SDK

Deprecated

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

The React SDK enables the integration of Wix JavaScript SDK APIs within React components. It's compatible with both Wix Headless and Wix Apps. When developing an app with dashboard extensions, the React SDK can be effectively used alongside the React Dashboard SDK.

The React SDK (@wix/sdk-react) includes everything from the regular SDK (@wix/sdk). As a result, you only have to install @wix/sdk-react, and you can import anything from @wix/sdk through @wix/sdk-react.

In addition, the React SDK offers the following components and hooks:

  • WixProvider: Enables the use of Wix JavaScript SDKs within React components. All functionality of @wix/sdk-react must be contained inside a Wix Provider.
  • useWixAuth(): Returns the authentication strategy of the enclosing WixProvider.
  • useWixFetchWithAuth(): Returns a function used to make API calls with a Wix access token in the Authorization header.
  • useWixModules(): Binds an SDK module to the authorization strategy of the enclosing WixProvider and returns an initialized module.

To get started using the React SDK, see Setup.

Did this help?