Step 1: Find a plugin slot that will support your functionality
BriteCore UI provides a slot that allows a third-party plugin to render an action button to execute actions on a quoting form, called the button-row slot.
Note: At this point, you can add plugins only to BriteQuote risk edit pages. In BriteCore, risks are the assets protected by the insurance; for example, auto.
Step 2: Add the script tag to your plugin HTML file
Add the following script to the header of your HTML file:
Sample code for the Capitalizer plugin
We are initializing the plugin with an object where the keys are the slots that our plugin needs to interact with, and the values are the objects expected during the slot initialization.
We are providing an array of objects containing:
- A label.
- A callback function to handle the form data and send the JSON Patch object back.
- Two booleans for visibility and an enabled state.
Upon load, the BriteCorePlugin object will start the connection to the plugin slot and, once that is done, it will emit an initialization event to the slot, sending along the object with the buttons it wants to be rendered. The slot will be waiting for such an event and will render the buttons wherever it is placed.