Note: This API is not intended for use in site development.
The Editor API enables code running within a Wix editor (for example in a settings panel) to interact with other parts of the editor. Using the API, you can access the properties of a widget on the editor canvas, retrieve data about the editor environment, and more.
To use the Editor API, install the @wix/editor
package.
Follow the installation instructions for your development environment.
Development environment | Installation method |
---|---|
Blocks apps | Use the package manager. |
CLI and self-hosted apps | Run npm install @wix/editor or yarn add @wix/editor . |
To use the package, follow the import and usage instructions below based on your development environment.
To use the Editor API in Wix-hosted apps, import one of the editor submodules in your code and call it's methods directly. For example:
To use the Editor API in self-hosted apps, first create a Wix Client using one of the editor submodules. For example:
Then, use the client to call the submodule's methods. For example: