Introduction

The Widget API enables you to get and set the properties of a site widget created using a self-hosted custom element. When you set a widget property, it triggers the attributeChangedCallback() function of the custom element because widget properties are bound to the attributes of the custom element.

To use the Widget API, install the @wix/editor package using npm or Yarn:

Copy
npm install @wix/editor

or

Copy
yarn add @wix/editor

Then import the widget module from @wix/editor:

Copy
import { widget } from '@wix/editor
Did this help?