Hello everyone,
I'm hoping someone in the community can shed some light on an integration issue I'm facing. I've been stuck on this for a couple of days and have exhausted the usual methods, so any advice would be greatly appreciated!
I'm developing a webphone panel for a telephony provider. This is built as a standalone Angular component that uses an <iframe>
and depends on the provider's JavaScript library, webphoneConnectorSDK.js
. The final component is intended to be used within our Creatio instance.
The Problem: The component behaves perfectly in my local Angular development environment (ng serve
). The SDK script loads, its global objects are available, and all functions work as expected.
However, once the component is built and deployed within the Creatio environment, it fails. I receive runtime errors indicating that the functions from the SDK cannot be found ( "WebphoneConnectorSDK is not defined"
).
What I've Already Tried:
I'm confident the script file is being loaded, but it seems it's not executing correctly or exposing its objects to the global window
scope inside Creatio.
-
Standard
<strong>angular.json</strong>
Method: I've added the script to the"scripts"
array in myangular.json
file."scripts": [ "src/assets/js/webphoneConnectorSDK.js" ]
I've verified after building that the SDK's code is present in the final, bundled
scripts.js
file, which is loaded on the page. Still, theWebphoneConnectorSDK
object isundefined
. - Dynamic Script Loading: I also tried creating a service in Angular to load the script dynamically and waiting for it to complete (
async/await
). The script'sonload
event fires successfully, but the result is the same.
My Questions for the Community:
- Has anyone else successfully integrated a third-party JS library (especially one that relies on the global
window
object) into a custom Angular component for Creatio? - Is there a known "best practice" or a specific integration pattern for this scenario that I'm missing?
- Are there any non-obvious Creatio settings or configurations that could be interfering with the execution of globally-scoped scripts?
I'd be incredibly grateful for any ideas, pointers, or shared experiences you might have. Thanks for taking the time to read!
Like