@opencx/widget
v5.14.1
Published
The default React widget. Embeddable in HTML.
Keywords
Readme
OpenCX Widget - Embed
The default React widget. Embeddable in HTML.
<script src="https://unpkg.com/@opencx/widget@latest/dist-embed/script.js"></script>
<script>
window.addEventListener('DOMContentLoaded', () => {
initOpenScript({ token: 'YOUR_WIDGET_TOKEN' });
});
</script>For all the available options, check the documentation.
Self-hosting
dist-embed/script.js is a self-contained classic script. Copy that single file
to your own server, as with v4. No sibling module or lazy chunks are required.
Apply your site's existing script CSP policy to the script tag.
Repeated script loads reuse the first loaded widget runtime and its React root.
Calling initOpenScript again updates its options. To switch widget versions,
reload the page.
Delivery and v5 runtime features
The script streams replies when your organization supports streaming and uses
classic send/poll delivery otherwise. Set streaming: false to keep send/poll.
Personal service connections stay off until declared:
initOpenScript({
token: 'YOUR_WIDGET_TOKEN',
capabilities: { connections: true },
});Companion layout is selected separately with displayMode: 'companion';
changing layout alone does not change delivery.
