Shipping to production

In-order to ship your widget to production, you can utilise the assets built in the dist folder.

There are a few ways you can utilise these to ensure your widget is production ready:

1) Self host your CSS/JS assets, and update the templates in the widget editor

You can utilise a CDN to host your CSS and JS files for the widget, and you can load them via the sdk by injecting the scripts into the placement:

Before injecting the scripts, dont forget to add the layout and tile handlebars data to the widget editor.

CSS

@import url('https://example.com/styles.css')

JS

sdk.addLoadedComponents(['https://example.com/widget.js']);

This should be performed inside the Javascript box and css box of the widget editor

2) Update the layouts, and templates in the widget editor

Place the dist file contents into the corresponding boxes on the widget editor and click Preview Changes.

Last updated

Was this helpful?