Scripts
Examples available
We provide a set of JavaScript objects to manage website widgets.
Main script STATIC_RESOURCES_URL/script.esm.js
includes WidgetAPI class.
WidgetAPI
constructor
Parameters
Parameter | Type | Description |
---|---|---|
config | object |
config example
{
staticResourcesUrl: 'STATIC_RESOURCES_URL'
}
showWidget
Parameters
Parameter | Type | Description |
---|---|---|
documentModel | object | Appearance model that was saved from the editor |
widgetConfig | object | Set of widget specific parameters, see below |
widgetConfig
{
type: 'BUILT_IN',
placements: [{
selector: '#widget',
insertType: 'AFTER_BEGIN'
}]
}
Example
https://github.com/Claspo/claspo-plugin-examples/blob/main/basic/script.html#L17-L24
Updated 4 months ago