Skip to content

Instantly share code, notes, and snippets.

@socraticprogrammer
Created September 10, 2024 13:10
Show Gist options
  • Save socraticprogrammer/da9ebaeacaaaead0ca92699e8c832952 to your computer and use it in GitHub Desktop.
Save socraticprogrammer/da9ebaeacaaaead0ca92699e8c832952 to your computer and use it in GitHub Desktop.
Implementation example of Widget from Genesys Cloud.
const customPlugin = CXBus.registerPlugin("Custom");
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Genesys Widget</title>
</head>
<body>
<h1>Genesys Widget</h1>
<button onclick="customPlugin.command('ClickToCall.open')" type="button">
Click to call
</button>
</body>
<script
src="https://apps.mypurecloud.com/widgets/9.0/cxbus.min.js"
onload="javascript:CXBus.configure({debug:false,pluginsPath:'https://apps.mypurecloud.com/widgets/9.0/plugins/'}); CXBus.loadFile('widget/widget.config.js').done(function(){CXBus.loadPlugin('widgets-core')});"
></script>
<script src="widget/click-to-call.js"></script>
</html>
window._genesys = {
widgets: {
main: {
preload: ["ClickToCall"],
},
clicktocall: {
enableCountdown: true,
provideAccessCode: true,
autoDialAccessCode: true,
ariaNumberExpirationIntervals: [100, 75, 50, 25, 10],
ewt: {
display: true,
queue: "Teste Produtos",
threshold: 30,
refreshInterval: 10,
},
confirmFormCloseEnabled: true,
dataURL: "http://www.myphoneservice.org",
formJSON: {},
userData: {},
},
},
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment