...
entity_class
– integration type (e.g., billing_customer, crm_account, self_care_customer, customer_care_portal or other string value);entity_
type –type
– entity type (e.g., customer, account, operator or other string value).
...
Code Block | ||||
---|---|---|---|---|
| ||||
<html> <head> <title>HydraOMS Widget</title> <script type="text/javascript" src="${hbw_assets_path}/assets/hbw.js"></script> <link rel="stylesheet" type="text/css" href="${hbw_assets_path}/assets/hbw.css"> </head> <body> <div id='hbw-container'></div> <script type="text/javascript"> var config = { entity_class: 'crm_account', entity_type: 'customer', container_id: 'hbw-container', // Same as <div> id locale: 'en' }; var entityId = ...; // Set here id or other uniq value of entity, like customerId window.hbw_widget = new (modulejs.require('HBW'))({ widgetContainer: `#${config.container_id}`, widgetPath: '/widget', entity_class: config.entity_class, entity_type: config.entity_type, entity_code: `${entityId}`, locale: config.locale, payload: { variables: { someInitialVariable: { // You can pass other useful information to process initial variables value: 'initialValue', type: 'string' } } } }); window.hbw_widget.render(); // If you use some kind ot SPA (Single Page Application), call this before exiting current page unmount: // window.hbw_widget.unmountWidget(); </script> </body> </html> |
...