Setup

Deprecated

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

To use the React SDK, install the @wix/sdk-react package:

Copy

Or

Copy

Then, import WixProvider, the authentication strategy to use, and any relevant hooks, like useWixModules:

Copy

Next, wrap your app in a WixProvider initialized with the appropriate authentication strategy:

Note: In most scenarios, the React SDK is used on client environments such as browsers and mobile apps. To ensure security, we recommend not to expose API keys in such environments given their administrative permissions. For more information, see Authorization Strategies.

Finally, to get an initialized instance of a Wix SDK module and call its functions, call the useWixModules() hook within the WixProvider:

Copy
Was this helpful?
Yes
No