Genesys Widgets Extensions
Genesys Widgets allows 3rd parties to create their own plugins/widgets to extend the default package. Extensions are an easy way to define your own while utilizing the same resources as core Genesys Widgets.
Defining Extensions
Extensions are defined at runtime before Genesys Widgets load. You can define them inline or include extensions in separate files, either grouped or separated.
Important
Define/Include your extensions AFTER your Genesys Widgets configuration object but BEFORE you include the Genesys Widgets JavaScript package<script>
// Make sure that the "extensions" object exists
// Always include this in your extensions
if(!window._genesys.cxwidget.extensions){
window._genesys.cxwidget.extensions = {};
}
// Create a new named property inside the "extensions" object and define it as a function
// When Genesys Widgets initializes it will step through each extension and invoke each function
// Genesys Widgets will share resources as arguments. These include: jQuery, CXBus, and CXCommon (common UI utilities)
window._genesys.cxwidget.extensions["TestExtension"] = function($, CXBus, CXCommon){
// Inside the extension function you create a new CXBus plugin.
// You can use this CXBus plugin to interface with other Genesys Widgets
// You can add your own UI controller logic in here or simply use the extension to
// connect an existing UI controller to the bus (e.g. share its API over the bus and coordinate actions with events)
var oTestExtension = CXBus.registerPlugin("TestExtension");
oTestExtension.subscribe("WebChat.opened", function(){});
};
</script>
Comments or questions about this documentation? Contact us for support!
