The SDK module can be used to authenticate and communicate with the Wix platform from JavaScript code. It offers a client for making authenticated calls to the Wix JavaScript SDK and REST APIs.
The SDK module provides the following methods and objects:
To use the SDK module, install the @wix/sdk package.
Follow the installation instructions for your development environment.
| Development environment | Installation method |
|---|---|
| Wix sites (editor or IDE) | Use the package manager. |
| Wix sites (local IDE) | Run wix install @wix/sdk using the Wix CLI. |
| Blocks apps | Use the same installation method as Wix sites. |
| CLI and self-hosted apps | Run npm install @wix/sdk or yarn add @wix/sdk. |
| Headless sites and apps | Run npm install @wix/sdk or yarn add @wix/sdk. |
SDK API calls must be authenticated using the OAuth protocol.
In Wix sites and Wix-hosted apps (CLI and Blocks), authentication is handled by Wix.
In self-hosted apps and headless projects, you need to create and use a Wix client.
Depending on the context of your code, you may need to elevate the method you want to call.
If you’re developing a wix App, you need to add permissions for the APIs you're calling in the Permissions page in your app's dashboard.