The Widget API enables you to interact with a site widget that's currently selected in the editor. Use this API in the widget's settings panel code.
To use the Widget API, follow the setup instructions for the Editor API.